Show
Ignore:
Timestamp:
04/14/06 10:17:56 (3 years ago)
Author:
jordi
Message:

Added the test for a file that don't have an outline.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/DocumentOutlineTest.cxx

    r58 r59  
    5151{ 
    5252    CPPUNIT_ASSERT ( !m_Document->isLoaded ()); 
    53      DocumentOutline *outline = m_Document->getOutline (); 
     53    DocumentOutline *outline = m_Document->getOutline (); 
    5454    // The initial state of the outline is no outline at all. 
    5555    CPPUNIT_ASSERT_EQUAL (0, outline->getNumChildren ()); 
     
    5858    CPPUNIT_ASSERT (NULL == outline->getFirstChild ()); 
    5959} 
     60 
     61/// 
     62/// @brief Test a file without outline. 
     63/// 
     64/// When a loaded document doesn't have an outline, the DocumentOutline's 
     65/// behaviour is exactly the same as the initial status. 
     66/// 
     67void 
     68DocumentOutlineTest::noOutline () 
     69{ 
     70    CPPUNIT_ASSERT (m_Document->loadFile (TEST_DATA_DIR "test2.pdf", 
     71                                          NULL, NULL)); 
     72    CPPUNIT_ASSERT (m_Document->isLoaded ()); 
     73    DocumentOutline *outline = m_Document->getOutline (); 
     74    CPPUNIT_ASSERT_EQUAL (0, outline->getNumChildren ()); 
     75    CPPUNIT_ASSERT (0 == g_ascii_strcasecmp ("", outline->getTitle ())); 
     76    CPPUNIT_ASSERT_EQUAL (1, outline->getDestinationPage ()); 
     77    CPPUNIT_ASSERT (NULL == outline->getFirstChild ()); 
     78}