Show
Ignore:
Timestamp:
04/20/06 02:37:27 (3 years ago)
Author:
jordi
Message:

The PDFDocument now can open files names that are in relative path.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/PDFDocumentTest.cxx

    r78 r91  
    3737    gchar *currentDir = g_get_current_dir (); 
    3838    gchar *filePath = g_build_filename (currentDir, TEST_DIR, fileName, NULL); 
     39    g_free (currentDir); 
    3940 
    4041    return filePath; 
     
    289290    g_free (testFile); 
    290291} 
     292 
     293/// 
     294/// @brief Test loading a relative path filename. 
     295/// 
     296/// Poppler's glib wrapper needs an URI instead of just a filename, but 
     297/// in order to build it I need an absolute path. This check test that 
     298/// giving a relative path converts it to absolute and loads the file 
     299/// properly. 
     300/// 
     301void 
     302PDFDocumentTest::relativePath () 
     303{ 
     304    CPPUNIT_ASSERT (m_Document->loadFile (TEST_DIR "test1.pdf", NULL, NULL)); 
     305    CPPUNIT_ASSERT (m_Document->isLoaded ()); 
     306    CPPUNIT_ASSERT_EQUAL (0, 
     307            g_ascii_strcasecmp (TEST_DIR "test1.pdf",  
     308                                m_Document->getFileName ())); 
     309} 
     310 
    291311 
    292312///