Changeset 78 for trunk/tests/DocumentOutlineTest.cxx
- Timestamp:
- 04/17/06 07:28:50 (3 years ago)
- Files:
-
- 1 modified
-
trunk/tests/DocumentOutlineTest.cxx (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/DocumentOutlineTest.cxx
r73 r78 23 23 // Register the test suite into the `registry'. 24 24 CPPUNIT_TEST_SUITE_REGISTRATION (DocumentOutlineTest); 25 26 /// 27 /// @brief Returns the path to the test data file. 28 /// 29 /// It assumes that TEST_DIR is defined to the relative 30 /// tests directory and that the checks are executed from the 31 /// test build dir. 32 /// 33 static gchar * 34 getTestFile (const gchar *fileName) 35 { 36 gchar *currentDir = g_get_current_dir (); 37 gchar *filePath = g_build_filename (currentDir, TEST_DIR, fileName, NULL); 38 39 return filePath; 40 } 25 41 26 42 /// … … 63 79 DocumentOutlineTest::noOutline () 64 80 { 65 CPPUNIT_ASSERT (m_Document->loadFile (TEST_DATA_DIR "test2.pdf",66 NULL, NULL));81 gchar *testFile = getTestFile ("test2.pdf"); 82 CPPUNIT_ASSERT (m_Document->loadFile (testFile, NULL, NULL)); 67 83 CPPUNIT_ASSERT (m_Document->isLoaded ()); 68 84 DocumentOutline *outline = m_Document->getOutline (); … … 73 89 CPPUNIT_ASSERT (NULL == outline->getFirstChild ()); 74 90 CPPUNIT_ASSERT (NULL == outline->getNextChild ()); 91 92 g_free (testFile); 75 93 } 76 94 … … 93 111 DocumentOutlineTest::hasOutline () 94 112 { 95 CPPUNIT_ASSERT (m_Document->loadFile (TEST_DATA_DIR "test1.pdf",96 NULL, NULL));113 gchar *testFile = getTestFile ("test1.pdf"); 114 CPPUNIT_ASSERT (m_Document->loadFile (testFile, NULL, NULL)); 97 115 CPPUNIT_ASSERT (m_Document->isLoaded ()); 98 116 DocumentOutline *outline = m_Document->getOutline (); … … 143 161 // Try again the "no outlined" file. 144 162 noOutline (); 163 164 g_free (testFile); 145 165 }
