Changeset 125

Show
Ignore:
Timestamp:
04/29/06 02:34:14 (2 years ago)
Author:
jordi
Message:

Added again one the old tests and also makes sure that calling the notifiedError() function from the dumb document observer makes it false again.

Location:
trunk/tests
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/DumbDocumentObserver.cxx

    r124 r125  
    7878DumbDocumentObserver::notifiedError (void) 
    7979{ 
    80     return m_NotifiedError; 
     80    gboolean notified = m_NotifiedError; 
     81    m_NotifiedError = FALSE; 
     82    return notified; 
    8183} 
    8284 
  • trunk/tests/PDFDocumentTest.cxx

    r124 r125  
    117117    g_free (testFile); 
    118118} 
    119 /* 
     119 
    120120/// 
    121121/// @brief Test that loading an invalid file fails. 
     
    127127PDFDocumentTest::invalidFile (void) 
    128128{ 
    129     GError *error = NULL; 
    130129    gchar *testFile = getTestFile ("PDFDocumentTest.cxx"); 
    131     CPPUNIT_ASSERT (m_Document->loadFile (testFile, NULL, &error)); 
    132     while ( !m_Observer->loadFinished () ) { } 
     130    m_Document->load (testFile, NULL); 
     131    while ( !m_Observer->loadFinished () ) { } 
     132    CPPUNIT_ASSERT (m_Observer->notifiedError ()); 
    133133    CPPUNIT_ASSERT (!m_Document->isLoaded ()); 
    134     CPPUNIT_ASSERT (m_Observer->notifiedError ()); 
    135134 
    136135    gchar *documentError = IDocument::getErrorMessage(DocumentErrorDamaged); 
     
    138137            "Failed to load document '%s'.\n%s\n", testFile, documentError); 
    139138    g_free(documentError); 
    140     error = m_Observer->getLoadError (); 
     139    const GError *error = m_Observer->getLoadError (); 
    141140    DocumentError errorCode = (DocumentError)error->code; 
    142141    CPPUNIT_ASSERT_EQUAL (DocumentErrorDamaged, errorCode); 
     
    146145    g_free (errorMessage); 
    147146} 
    148  
     147/* 
    149148/// 
    150149/// @brief Test to load an encrypted file using invalid passwords. 
  • trunk/tests/PDFDocumentTest.h

    r124 r125  
    2828        CPPUNIT_TEST (emptyDocument); 
    2929        CPPUNIT_TEST (fileNotFound); 
    30 /*        CPPUNIT_TEST (invalidFile); 
    31         CPPUNIT_TEST (encryptedFile); 
     30        CPPUNIT_TEST (invalidFile); 
     31/*        CPPUNIT_TEST (encryptedFile); 
    3232        CPPUNIT_TEST (validFile); 
    3333        CPPUNIT_TEST (relativePath);