Changeset 205

Show
Ignore:
Timestamp:
06/10/06 05:34:50 (2 years ago)
Author:
jordi
Message:

I've added the missing pure virtual function from last week and also added a new test function for the Config class to test the last saved folder option.

Location:
trunk/tests
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/ConfigTest.cxx

    r193 r205  
    6060    CPPUNIT_ASSERT (config.showStatusbar ()); 
    6161    CPPUNIT_ASSERT_EQUAL ((gchar *)NULL, config.getOpenFileFolder ()); 
     62    CPPUNIT_ASSERT_EQUAL ((gchar *)NULL, config.getSaveFileFolder ()); 
    6263    CPPUNIT_ASSERT (!config.zoomToWidth ()); 
    6364    CPPUNIT_ASSERT (!config.zoomToFit ()); 
     
    7879    config.setWindowPos (30, 40); 
    7980    config.setWindowSize (100, 90); 
    80      
     81 
    8182    CPPUNIT_ASSERT_EQUAL (30, config.getWindowX ()); 
    8283    CPPUNIT_ASSERT_EQUAL (40, config.getWindowY ()); 
     
    100101 
    101102/// 
    102 /// @brief Checks setting the value for showing the statusbar. 
     103/// @brief Checks setting the value for showing the status bar. 
    103104/// 
    104105void 
     
    117118/// 
    118119void 
    119 ConfigTest::currentFolder () 
     120ConfigTest::openCurrentFolder () 
    120121{ 
    121122    Config &config = Config::getConfig (); 
     
    123124    config.setOpenFileFolder ("/tmp"); 
    124125    gchar *openFolder = config.getOpenFileFolder (); 
    125     CPPUNIT_ASSERT ( 0 == g_ascii_strcasecmp("/tmp", openFolder)); 
     126    CPPUNIT_ASSERT ( 0 == g_ascii_strcasecmp ("/tmp", openFolder)); 
    126127    g_free (openFolder); 
     128} 
     129 
     130/// 
     131/// @brief Check setting the current folder for saving files. 
     132/// 
     133void 
     134ConfigTest::saveCurrentFolder () 
     135{ 
     136    Config &config = Config::getConfig (); 
     137 
     138    config.setSaveFileFolder ("/home"); 
     139    gchar *saveFolder = config.getSaveFileFolder (); 
     140    CPPUNIT_ASSERT ( 0 == g_ascii_strcasecmp ("/home", saveFolder)); 
     141    g_free (saveFolder); 
    127142} 
    128143 
     
    171186{ 
    172187    Config &config = Config::getConfig (); 
    173     
     188 
    174189    config.setExternalBrowserCommandLine ("galeon %s"); 
    175190    gchar *commandLine = config.getExternalBrowserCommandLine (); 
    176191    CPPUNIT_ASSERT ( 0 == g_ascii_strcasecmp ("galeon %s", commandLine)); 
    177192    g_free (commandLine); 
    178      
     193 
    179194    config.setExternalBrowserCommandLine ("xterm -e lynx %s"); 
    180195    commandLine = config.getExternalBrowserCommandLine (); 
  • trunk/tests/ConfigTest.h

    r193 r205  
    3030        CPPUNIT_TEST (showToolbar); 
    3131        CPPUNIT_TEST (showStatusbar); 
    32         CPPUNIT_TEST (currentFolder); 
     32        CPPUNIT_TEST (openCurrentFolder); 
     33        CPPUNIT_TEST (saveCurrentFolder); 
    3334        CPPUNIT_TEST (zoomValues); 
    3435        CPPUNIT_TEST (externalBrowser); 
     
    4344            void showToolbar (void); 
    4445            void showStatusbar (void); 
    45             void currentFolder (void); 
     46            void openCurrentFolder (void); 
     47            void saveCurrentFolder (void); 
    4648            void zoomValues (void); 
    4749            void externalBrowser (void); 
  • trunk/tests/DumbDocument.cxx

    r158 r205  
    100100} 
    101101 
     102gboolean 
     103DumbDocument::saveFile (const gchar *filename, GError **error) 
     104{ 
     105    // Do nothing. 
     106    return TRUE; 
     107} 
     108 
    102109//////////////////////////////////////////////////////////////// 
    103110// Tests Methods 
  • trunk/tests/DumbDocument.h

    r158 r205  
    3535                                     gdouble *height); 
    3636            DocumentPage *renderPage (gint pageNum); 
     37            gboolean saveFile (const gchar *filename, GError **error); 
    3738 
    3839            // Test functions. 
  • trunk/tests/DumbMainView.cxx

    r177 r205  
    7373    g_free (m_Title); 
    7474} 
    75              
    76 void  
     75 
     76void 
    7777DumbMainView::activeZoomFit (gboolean active) 
    7878{ 
     
    8080} 
    8181 
    82 void  
     82void 
    8383DumbMainView::activeZoomWidth (gboolean active) 
    8484{ 
     
    9797    return m_PageView; 
    9898} 
    99              
     99 
     100IPreferencesView * 
     101DumbMainView::getPreferencesView () 
     102{ 
     103    return (IPreferencesView *)0; 
     104} 
     105 
    100106gchar * 
    101107DumbMainView::openFileDialog (const gchar *lastFolder) 
     
    113119} 
    114120 
     121gchar * 
     122DumbMainView::saveFileDialog (const gchar *lastFolder) 
     123{ 
     124    // Do nothing. 
     125    return g_strdup (""); 
     126} 
     127 
    115128void 
    116129DumbMainView::sensitiveGoToFirstPage (gboolean sensitive) 
     
    166179} 
    167180 
    168 void  
     181void 
    169182DumbMainView::sensitiveRotateRight (gboolean sensitive) 
    170183{ 
    171184    m_SensitiveRotateRight = sensitive; 
     185} 
     186 
     187void 
     188DumbMainView::sensitiveSave (gboolean sensitive) 
     189{ 
     190} 
     191 
     192void 
     193DumbMainView::sensitiveZoom (gboolean sensitive) 
     194{ 
    172195} 
    173196 
     
    200223{ 
    201224    return (const gchar *)m_GoToPageText; 
     225} 
     226 
     227const gchar * 
     228DumbMainView::getZoomText () 
     229{ 
     230    return ""; 
    202231} 
    203232 
     
    236265void 
    237266DumbMainView::setStatusBarText (const gchar *text) 
     267{ 
     268} 
     269 
     270void 
     271DumbMainView::setZoomText (const gchar *text) 
    238272{ 
    239273} 
  • trunk/tests/DumbMainView.h

    r173 r205  
    3636            IFindView *getFindView (void); 
    3737            IPageView *getPageView (void); 
     38            IPreferencesView *getPreferencesView (void); 
     39            const gchar *getZoomText (void); 
    3840            gchar *openFileDialog (const gchar *lastFolder); 
    3941            gchar *promptPasswordDialog (void); 
     42            char *saveFileDialog (const gchar *lastFolder); 
    4043            void sensitiveFind (gboolean sensitive); 
    4144            void sensitiveGoToFirstPage (gboolean sensitive); 
     
    4851            void sensitiveRotateLeft (gboolean sensitive); 
    4952            void sensitiveRotateRight (gboolean sensitive); 
     53            void sensitiveSave (gboolean sensitive); 
     54            void sensitiveZoom (gboolean sensitive); 
    5055            void sensitiveZoomIn (gboolean sensitive); 
    5156            void sensitiveZoomOut (gboolean sensitive); 
     
    5560            void setCursor (ViewCursor cursorType); 
    5661            void setTotalPages (gint pages); 
    57             void setGoToPageText (const char *text);             
     62            void setGoToPageText (const char *text); 
    5863            void setTitle (const gchar *title); 
    5964            void setOutline (DocumentOutline *outline); 
    6065            void setStatusBarText (const gchar *text); 
     66            void setZoomText (const gchar *text); 
    6167            void show (void); 
    6268            void showErrorMessage (const gchar *title, const gchar *body);