Changeset 54

Show
Ignore:
Timestamp:
04/14/06 05:08:13 (2 years ago)
Author:
jordi
Message:

Increment ePDFView's version number.
The MainPterTest? doesn't include the epdfview.h header file, because I thought that it was the problem about the memory used by the compiler. It turns out that the problem was that some functions are TOO LONG and the compiler maxs out the memory (128MiB, thats it) and the system starts to swapping. Now I have reduced the compile time from 3 minutes and halt to 1 minute, and the system doesn't freeze :-)

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r49 r54  
    11dnl Process this file with autoconf to produce a configure script. 
    2 AC_INIT([ePDFView], [0.1.0], [jordi@emma-soft.com]) 
     2AC_INIT([ePDFView], [0.1.1], [jordi@emma-soft.com]) 
    33AC_PREREQ([2.13]) 
    44AC_CONFIG_HEADER([config.h]) 
  • trunk/src/IDocument.h

    r49 r54  
    2424namespace ePDFView  
    2525{ 
     26    // Forward declarations. 
     27    class DocumentPage; 
     28    class DocumentIndex; 
     29 
    2630    /// 
    2731    /// @brief Defines the possible errors loading a document. 
  • trunk/tests/MainPterTest.cxx

    r36 r54  
    1616// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
    1717 
    18 #include <epdfview.h> 
     18#include <glib.h> 
     19#include <IDocument.h> 
     20#include <IMainView.h> 
     21#include <MainPter.h> 
    1922#include "DumbDocument.h" 
    2023#include "DumbMainView.h" 
     
    4649    // We only need to delete the presenter, as all other 
    4750    // classes are deleted by it. 
    48 //    delete m_MainPter; 
    49 } 
     51    delete m_MainPter; 
     52} 
     53 
    5054 
    5155/// 
     
    295299    CPPUNIT_ASSERT_EQUAL (1, m_View->getCurrentPage ()); 
    296300    CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
     301    // This is to check that after calling this function, it returns false 
     302    // because no page can be shown between the two... (I didn't called 
     303    // the presenter or the view, yet) 
    297304    CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    298305    // Going to the next page should make all actions sensitive. 
     
    305312    CPPUNIT_ASSERT (m_View->isSensitiveGoToPreviousPage ()); 
    306313    CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    307     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    308314    // Going to the last will make some unsensitive. 
    309315    m_MainPter->goToLastPageActivated (); 
     
    315321    CPPUNIT_ASSERT (m_View->isSensitiveGoToPreviousPage ()); 
    316322    CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    317     CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    318323    // Again to the last won't harm (just in case...) nor going next. 
    319324    m_MainPter->goToLastPageActivated (); 
     
    358363    CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    359364    CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
     365} 
     366 
     367/// 
     368/// @brief Test the page navigation using the entry on the toolbar. 
     369/// 
     370/// The application has a text entry that the user can use to to a  
     371/// page just by writting the number. Any non number after the first number 
     372/// character will be discarded. 
     373/// 
     374void 
     375MainPterTest::pageNavigationEntry () 
     376{ 
     377    m_View->setOpenFileName ("/tmp/test.pdf"); 
     378    m_Document->setNumPages (4); 
     379    m_MainPter->openFileActivated (); 
     380    // Check that sets the correct number of pages and the current page. 
     381    CPPUNIT_ASSERT_EQUAL (4, m_View->getTotalPages ()); 
     382    CPPUNIT_ASSERT_EQUAL (1, m_View->getCurrentPage ()); 
     383    CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    360384 
    361385    // Now try again using the page entry on toolbar. 
    362     m_View->setGoToPageText ("2"); 
     386    m_View->setGoToPageText ("2 of 4"); 
    363387    m_MainPter->goToPageActivated (); 
    364388    CPPUNIT_ASSERT_EQUAL (2, m_View->getCurrentPage ());  
     
    371395    CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    372396 
    373     m_View->setGoToPageText ("4"); 
     397    m_View->setGoToPageText ("4 of 4"); 
    374398    m_MainPter->goToPageActivated (); 
    375399    CPPUNIT_ASSERT_EQUAL (4, m_View->getCurrentPage ());  
     
    382406    CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    383407 
    384     m_View->setGoToPageText ("1"); 
     408    m_View->setGoToPageText ("1 of 4"); 
    385409    m_MainPter->goToPageActivated (); 
    386410    CPPUNIT_ASSERT_EQUAL (1, m_View->getCurrentPage ());  
     
    394418 
    395419    // Invalid values. 
    396     m_View->setGoToPageText ("123123"); 
     420    m_View->setGoToPageText ("123123 of 1"); 
    397421    m_MainPter->goToPageActivated (); 
    398422    CPPUNIT_ASSERT_EQUAL (4, m_View->getCurrentPage ());  
     
    405429    CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    406430 
    407     m_View->setGoToPageText ("0"); 
     431    m_View->setGoToPageText ("0 of 12"); 
    408432    m_MainPter->goToPageActivated (); 
    409433    CPPUNIT_ASSERT_EQUAL (1, m_View->getCurrentPage ());  
     
    417441 
    418442    m_MainPter->goToNextPageActivated (); 
    419     m_View->setGoToPageText ("Jejej"); 
     443    m_View->setGoToPageText ("Jejej :-)"); 
    420444    m_MainPter->goToPageActivated (); 
    421445    CPPUNIT_ASSERT_EQUAL (1, m_View->getCurrentPage ());  
     
    527551    CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 
    528552} 
     553 
  • trunk/tests/MainPterTest.h

    r31 r54  
    3434        CPPUNIT_TEST (goodPassword); 
    3535        CPPUNIT_TEST (pageNavigation); 
     36        CPPUNIT_TEST (pageNavigationEntry); 
    3637        CPPUNIT_TEST (pageRotate); 
    3738        CPPUNIT_TEST (pageZoom); 
     
    5051            void goodPassword (void); 
    5152            void pageNavigation (void); 
     53            void pageNavigationEntry (void); 
    5254            void pageRotate (void); 
    5355            void pageZoom (void);