Show
Ignore:
Timestamp:
05/14/10 12:16:00 (14 years ago)
Author:
mido
Message:

the functionality of user info was improved, it supports an initialization of root descendant via UI::get directly, however it is save only for static attributes, for dynamically allocated attributes UI::build should be called to handle with intahrence issues

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/tests/testsuite/user_info_test.cpp

    r722 r942  
    9595                Setting &manufacturer_setting = set.add ( "manufacturer", Setting::TypeString ); 
    9696                manufacturer_setting = manufacturer; 
     97        } 
     98 
     99        virtual string to_string() const 
     100        { 
     101                return "the method to_string() is not implemented"; 
    97102        } 
    98103}; 
     
    202207        CHECK_EQUAL ( string ( "A car made in 1998 by audi, having 25000 kilometers on the clock.The names of passengers are as follows: Karlos Novak -1_CygWin_Matlab_Aimsun Karlosik Novacek " ), pepikovo->to_string() ); 
    203208 
     209        Transport pepikovo_static; 
     210        UI::get( pepikovo_static, in, "pepikovo", UI::compulsory ); 
     211        CHECK_EQUAL ( string ( "the method to_string() is not implemented" ), pepikovo_static.to_string() ); 
     212         
    204213        shared_ptr<Transport> jardovo ( UI::build<Transport> ( in, "jardovo", UI::compulsory ) ); 
    205214        CHECK_EQUAL ( string ( "A car made in 1992 by liaz, having 1555000 kilometers on the clock." ), jardovo->to_string() );