Changeset 59

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

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

Location:
trunk/tests
Files:
2 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} 
  • trunk/tests/DocumentOutlineTest.h

    r58 r59  
    2727        CPPUNIT_TEST_SUITE (DocumentOutlineTest); 
    2828        CPPUNIT_TEST (initialStatus); 
     29        CPPUNIT_TEST (noOutline); 
    2930        CPPUNIT_TEST_SUITE_END (); 
    3031 
     
    3435 
    3536            void initialStatus (void); 
     37            void noOutline (void); 
    3638 
    3739        protected: