Show
Ignore:
Timestamp:
04/20/06 11:13:01 (3 years ago)
Author:
jordi
Message:

Divided the pageZoom function from the MainPter? test to ZoomInAndOut?, ZoomWidth? and ZoomFit?, because I'm planning to make ZoomToWith? and ZoomToHeigh? toggle action that deserved separate test cases.

Also added the ZoomToFit? and ZoomToWidth? options to the configuration class. Also the test case was added.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/ConfigTest.cxx

    r96 r98  
    5858    CPPUNIT_ASSERT_EQUAL (650, config.getWindowHeight ()); 
    5959    CPPUNIT_ASSERT_EQUAL ((gchar *)NULL, config.getOpenFileFolder ()); 
     60    CPPUNIT_ASSERT ( !config.zoomToWidth () ); 
     61    CPPUNIT_ASSERT ( !config.zoomToFit () ); 
    6062} 
    6163 
     
    9092    g_free (openFolder); 
    9193} 
     94 
     95/// 
     96/// @brief Check setting the zoom values. 
     97/// 
     98/// Especially check that zoomToWidth() and zoomToFit() can't be 
     99/// set both to true. 
     100/// 
     101void 
     102ConfigTest::zoomValues () 
     103{ 
     104    Config &config = Config::getConfig (); 
     105     
     106    config.setZoomToFit (TRUE); 
     107    CPPUNIT_ASSERT ( !config.zoomToWidth () ); 
     108    CPPUNIT_ASSERT ( config.zoomToFit () ); 
     109    config.setZoomToFit (FALSE); 
     110    CPPUNIT_ASSERT ( !config.zoomToWidth () ); 
     111    CPPUNIT_ASSERT ( !config.zoomToFit () ); 
     112    config.setZoomToWidth (TRUE); 
     113    CPPUNIT_ASSERT ( config.zoomToWidth () ); 
     114    CPPUNIT_ASSERT ( !config.zoomToFit () ); 
     115    config.setZoomToWidth (FALSE); 
     116    CPPUNIT_ASSERT ( !config.zoomToWidth () ); 
     117    CPPUNIT_ASSERT ( !config.zoomToFit () ); 
     118    config.setZoomToFit (TRUE); 
     119    CPPUNIT_ASSERT ( !config.zoomToWidth () ); 
     120    CPPUNIT_ASSERT ( config.zoomToFit () ); 
     121    config.setZoomToWidth (TRUE); 
     122    CPPUNIT_ASSERT ( config.zoomToWidth () ); 
     123    CPPUNIT_ASSERT ( !config.zoomToFit () ); 
     124    config.setZoomToFit (TRUE); 
     125    CPPUNIT_ASSERT ( !config.zoomToWidth () ); 
     126    CPPUNIT_ASSERT ( config.zoomToFit () ); 
     127    config.setZoomToFit (FALSE); 
     128    CPPUNIT_ASSERT ( !config.zoomToWidth () ); 
     129    CPPUNIT_ASSERT ( !config.zoomToFit () ); 
     130}