[poppler] poppler/qt4/tests: check_fonts.cpp, 1.3, 1.4 check_metadata.cpp, 1.5, 1.6 check_pagelayout.cpp, 1.2, 1.3 check_pagemode.cpp, 1.2, 1.3 check_permissions.cpp, 1.3, 1.4 check_version.cpp, 1.1, NONE poppler-fonts.cpp, 1.2, 1.3 stress-poppler-qt4.cpp, 1.2, 1.3

Brad Hards bradh at freedesktop.org
Wed Dec 28 01:23:45 PST 2005


Update of /cvs/poppler/poppler/qt4/tests
In directory gabe:/tmp/cvs-serv20360/qt4/tests

Modified Files:
	check_fonts.cpp check_metadata.cpp check_pagelayout.cpp 
	check_pagemode.cpp check_permissions.cpp poppler-fonts.cpp 
	stress-poppler-qt4.cpp 
Removed Files:
	check_version.cpp 
Log Message:
Plug a few memory leaks in the Qt4 bindings.


Index: check_fonts.cpp
===================================================================
RCS file: /cvs/poppler/poppler/qt4/tests/check_fonts.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- check_fonts.cpp	6 Dec 2005 09:58:04 -0000	1.3
+++ check_fonts.cpp	28 Dec 2005 09:23:43 -0000	1.4
@@ -21,6 +21,8 @@
 
     QList<Poppler::FontInfo> listOfFonts = doc->fonts();
     QCOMPARE( listOfFonts.size(), 0 );
+
+    delete doc;
 }
 
 void TestFontsData::checkType1()
@@ -37,6 +39,8 @@
 
     QCOMPARE( listOfFonts.at(0).isEmbedded(), false );
     QCOMPARE( listOfFonts.at(0).isSubset(), false );
+
+    delete doc;
 }
 
 void TestFontsData::checkType3()
@@ -60,6 +64,8 @@
 
     QCOMPARE( listOfFonts.at(1).isEmbedded(), true );
     QCOMPARE( listOfFonts.at(1).isSubset(), false );
+
+    delete doc;
 }
 
 void TestFontsData::checkTrueType()
@@ -83,6 +89,8 @@
 
     QCOMPARE( listOfFonts.at(1).isEmbedded(), false );
     QCOMPARE( listOfFonts.at(1).isSubset(), false );
+
+    delete doc;
 }
 
 QTEST_MAIN(TestFontsData)

Index: check_metadata.cpp
===================================================================
RCS file: /cvs/poppler/poppler/qt4/tests/check_metadata.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- check_metadata.cpp	27 Dec 2005 06:10:02 -0000	1.5
+++ check_metadata.cpp	28 Dec 2005 09:23:43 -0000	1.6
@@ -46,6 +46,8 @@
     QFETCH( QString, key );
     QFETCH( QString, value );
     QCOMPARE( doc->info(key), value );
+
+    delete doc;
 }
 
 void TestMetaData::checkStrings2_data()
@@ -71,6 +73,8 @@
     QFETCH( QString, key );
     QFETCH( QString, value );
     QCOMPARE( doc->info(key), value );
+
+    delete doc;
 }
 
 void TestMetaData::checkStringKeys()
@@ -86,6 +90,8 @@
     QStringList keysInDoc = doc->infoKeys();
     keysInDoc.sort();
     QCOMPARE( keysInDoc, keyList );
+
+    delete doc;
 }
 
 void TestMetaData::checkLinearised()
@@ -96,10 +102,14 @@
 
     QVERIFY( doc->isLinearized() );
 
+    delete doc;
+
     doc = Poppler::Document::load("../../../test/unittestcases/truetype.pdf");
     QVERIFY( doc );
     QEXPECT_FAIL("", "We don't yet handle linearisation correctly", Continue);
     QCOMPARE( doc->isLinearized(), false );
+
+    delete doc;
 }
 
 void TestMetaData::checkPortraitOrientation()
@@ -108,7 +118,11 @@
     doc = Poppler::Document::load("../../../test/unittestcases/orientation.pdf");
     QVERIFY( doc );
   
-    QCOMPARE( doc->page(0)->orientation(), Poppler::Page::Portrait );
+    Poppler::Page *page = doc->page(0);
+    QCOMPARE( page->orientation(), Poppler::Page::Portrait );
+
+    delete page;
+    delete doc;
 }
 
 void TestMetaData::checkNumPages()
@@ -118,9 +132,13 @@
     QVERIFY( doc );
     QCOMPARE( doc->numPages(), 2 );
 
+    delete doc;
+
     doc = Poppler::Document::load("../../../test/unittestcases/truetype.pdf");
     QVERIFY( doc );
     QCOMPARE( doc->numPages(), 1 );
+
+    delete doc;
 }
 
 void TestMetaData::checkDate()
@@ -131,6 +149,8 @@
     QVERIFY( doc );
     QCOMPARE( doc->date("ModDate"), QDateTime(QDate(2005, 12, 5), QTime(9,44,46), Qt::UTC ) );
     QCOMPARE( doc->date("CreationDate"), QDateTime(QDate(2005, 8, 13), QTime(1,12,11), Qt::UTC ) );
+
+    delete doc;
 }
 
 void TestMetaData::checkPageSize()
@@ -139,8 +159,12 @@
 
     doc = Poppler::Document::load("../../../test/unittestcases/truetype.pdf");
     QVERIFY( doc );
-    QCOMPARE( doc->page(0)->pageSize(), QSize(595, 842) );
-    QCOMPARE( doc->page(0)->pageSizeF(), QSizeF(595.22, 842) );
+    Poppler::Page *page = doc->page(0);
+    QCOMPARE( page->pageSize(), QSize(595, 842) );
+    QCOMPARE( page->pageSizeF(), QSizeF(595.22, 842) );
+
+    delete page;
+    delete doc;
 }
 
 
@@ -150,7 +174,11 @@
     doc = Poppler::Document::load("../../../test/unittestcases/orientation.pdf");
     QVERIFY( doc );
   
-    QCOMPARE( doc->page(1)->orientation(), Poppler::Page::Landscape );
+    Poppler::Page *page = doc->page(1);
+    QCOMPARE( page->orientation(), Poppler::Page::Landscape );
+
+    delete page;
+    delete doc;
 }
 
 void TestMetaData::checkUpsideDownOrientation()
@@ -159,7 +187,11 @@
     doc = Poppler::Document::load("../../../test/unittestcases/orientation.pdf");
     QVERIFY( doc );
 
-    QCOMPARE( doc->page(2)->orientation(), Poppler::Page::UpsideDown );
+    Poppler::Page *page = doc->page(2);
+    QCOMPARE( page->orientation(), Poppler::Page::UpsideDown );
+
+    delete page;
+    delete doc;
 }
 
 void TestMetaData::checkSeascapeOrientation()
@@ -168,7 +200,11 @@
     doc = Poppler::Document::load("../../../test/unittestcases/orientation.pdf");
     QVERIFY( doc );
 
-    QCOMPARE( doc->page(3)->orientation(), Poppler::Page::Seascape );
+    Poppler::Page *page = doc->page(3);
+    QCOMPARE( page->orientation(), Poppler::Page::Seascape );
+
+    delete page;
+    delete doc;
 }
 
 void TestMetaData::checkVersion()
@@ -178,6 +214,8 @@
     QVERIFY( doc );
 
     QCOMPARE( doc->pdfVersion(), 1.6 );
+
+    delete doc;
 }
 
 QTEST_MAIN(TestMetaData)

Index: check_pagelayout.cpp
===================================================================
RCS file: /cvs/poppler/poppler/qt4/tests/check_pagelayout.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- check_pagelayout.cpp	27 Nov 2005 01:33:51 -0000	1.2
+++ check_pagelayout.cpp	28 Dec 2005 09:23:43 -0000	1.3
@@ -19,6 +19,8 @@
     QVERIFY( doc );
   
     QCOMPARE( doc->pageLayout(), Poppler::Document::NoLayout );
+
+    delete doc;
 }
 
 void TestPageLayout::checkSingle()
@@ -28,6 +30,8 @@
     QVERIFY( doc );
   
     QCOMPARE( doc->pageLayout(), Poppler::Document::SinglePage );
+
+    delete doc;
 }
 
 void TestPageLayout::checkFacing()
@@ -37,6 +41,8 @@
     QVERIFY( doc );
 
     QCOMPARE( doc->pageLayout(), Poppler::Document::TwoPageRight );
+
+    delete doc;
 }
 
 QTEST_MAIN(TestPageLayout)

Index: check_pagemode.cpp
===================================================================
RCS file: /cvs/poppler/poppler/qt4/tests/check_pagemode.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- check_pagemode.cpp	27 Nov 2005 01:33:51 -0000	1.2
+++ check_pagemode.cpp	28 Dec 2005 09:23:43 -0000	1.3
@@ -21,6 +21,8 @@
     QVERIFY( doc );
   
     QCOMPARE( doc->pageMode(), Poppler::Document::UseNone );
+
+    delete doc;
 }
 
 void TestPageMode::checkFullScreen()
@@ -30,6 +32,8 @@
     QVERIFY( doc );
 
     QCOMPARE( doc->pageMode(), Poppler::Document::FullScreen );
+
+    delete doc;
 }
 
 void TestPageMode::checkAttachments()
@@ -39,6 +43,8 @@
     QVERIFY( doc );
   
     QCOMPARE( doc->pageMode(), Poppler::Document::UseAttach );
+
+    delete doc;
 }
 
 void TestPageMode::checkThumbs()
@@ -48,6 +54,8 @@
     QVERIFY( doc );
 
     QCOMPARE( doc->pageMode(), Poppler::Document::UseThumbs );
+
+    delete doc;
 }
 
 void TestPageMode::checkOC()
@@ -57,6 +65,8 @@
     QVERIFY( doc );
 
     QCOMPARE( doc->pageMode(), Poppler::Document::UseOC );
+
+    delete doc;
 }
 
 QTEST_MAIN(TestPageMode)

Index: check_permissions.cpp
===================================================================
RCS file: /cvs/poppler/poppler/qt4/tests/check_permissions.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- check_permissions.cpp	27 Nov 2005 01:33:51 -0000	1.3
+++ check_permissions.cpp	28 Dec 2005 09:23:43 -0000	1.4
@@ -36,6 +36,8 @@
 
     // we are allowed to assemble this document
     QVERIFY( doc->okToAssemble() );
+
+    delete doc;
 }
 
 QTEST_MAIN(TestPermissions)

--- check_version.cpp DELETED ---

Index: poppler-fonts.cpp
===================================================================
RCS file: /cvs/poppler/poppler/qt4/tests/poppler-fonts.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- poppler-fonts.cpp	6 Jul 2005 09:52:30 -0000	1.2
+++ poppler-fonts.cpp	28 Dec 2005 09:23:43 -0000	1.3
@@ -71,4 +71,5 @@
 	}
 	std::cout << std::endl;
     }
+    delete doc;
 }

Index: stress-poppler-qt4.cpp
===================================================================
RCS file: /cvs/poppler/poppler/qt4/tests/stress-poppler-qt4.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- stress-poppler-qt4.cpp	4 Jul 2005 08:18:52 -0000	1.2
+++ stress-poppler-qt4.cpp	28 Dec 2005 09:23:43 -0000	1.3
@@ -57,10 +57,12 @@
 		    page->renderToPixmap(pixmap);
 		    page->pageSize();
 		    page->orientation();
+		    delete page;
 		    std::cout << ".";
 		    std::cout.flush();
 		}
 		std::cout << std::endl;
+		delete doc;
 	    }
 	}
     }



More information about the poppler mailing list