Changeset 193

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

The test functions for the external browser command line option.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tests/ConfigTest.cxx

    r100 r193  
    5757    CPPUNIT_ASSERT_EQUAL (600, config.getWindowWidth ()); 
    5858    CPPUNIT_ASSERT_EQUAL (650, config.getWindowHeight ()); 
    59     CPPUNIT_ASSERT ( config.showToolbar () ); 
    60     CPPUNIT_ASSERT ( config.showStatusbar () ); 
     59    CPPUNIT_ASSERT (config.showToolbar ()); 
     60    CPPUNIT_ASSERT (config.showStatusbar ()); 
    6161    CPPUNIT_ASSERT_EQUAL ((gchar *)NULL, config.getOpenFileFolder ()); 
    62     CPPUNIT_ASSERT ( !config.zoomToWidth () ); 
    63     CPPUNIT_ASSERT ( !config.zoomToFit () ); 
     62    CPPUNIT_ASSERT (!config.zoomToWidth ()); 
     63    CPPUNIT_ASSERT (!config.zoomToFit ()); 
     64 
     65    gchar *commandLine = config.getExternalBrowserCommandLine (); 
     66    CPPUNIT_ASSERT (0 == g_ascii_strcasecmp ("firefox %s", commandLine)); 
     67    g_free (commandLine); 
    6468} 
    6569 
     
    159163    CPPUNIT_ASSERT ( !config.zoomToFit () ); 
    160164} 
     165 
     166/// 
     167/// @brief Checks setting the external browser command line. 
     168/// 
     169void 
     170ConfigTest::externalBrowser () 
     171{ 
     172    Config &config = Config::getConfig (); 
     173    
     174    config.setExternalBrowserCommandLine ("galeon %s"); 
     175    gchar *commandLine = config.getExternalBrowserCommandLine (); 
     176    CPPUNIT_ASSERT ( 0 == g_ascii_strcasecmp ("galeon %s", commandLine)); 
     177    g_free (commandLine); 
     178     
     179    config.setExternalBrowserCommandLine ("xterm -e lynx %s"); 
     180    commandLine = config.getExternalBrowserCommandLine (); 
     181    CPPUNIT_ASSERT ( 0 == g_ascii_strcasecmp ("xterm -e lynx %s", commandLine)); 
     182    g_free (commandLine); 
     183} 
  • trunk/tests/ConfigTest.h

    r100 r193  
    3232        CPPUNIT_TEST (currentFolder); 
    3333        CPPUNIT_TEST (zoomValues); 
     34        CPPUNIT_TEST (externalBrowser); 
    3435        CPPUNIT_TEST_SUITE_END (); 
    3536 
     
    4445            void currentFolder (void); 
    4546            void zoomValues (void); 
     47            void externalBrowser (void); 
    4648    }; 
    4749}