Changeset 256 for tests

Show
Ignore:
Timestamp:
01/28/09 10:01:18 (16 years ago)
Author:
smidl
Message:

uibuilder works (again)

Location:
tests
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • tests/CMakeLists.txt

    r249 r256  
    44# Make sure the linker can find the Hello library once it is built. 
    55link_directories (${BDM_BINARY_DIR}/bdm) 
    6  
    7 # Define macro for testing a file 
    8 MACRO(TEST FN) 
    9         add_executable (${FN} ${FN}.cpp) 
    10         target_link_libraries (${FN} debug itpp_debug) 
    11         target_link_libraries (${FN} optimized itpp) 
    12         target_link_libraries (${FN} bdm ${AddLib}) 
    13 ENDMACRO(TEST) 
    146 
    157# Add executable called "helloDemo" that is built from the source files 
  • tests/UI/UIbuilder_test.cpp

    r254 r256  
    55using namespace bdm; 
    66 
    7 class cls { 
     7class cls :public bdmroot{ 
    88        public: 
    99                int a; 
     
    2121        public: 
    2222        UItest():UIbuilder("test"){} 
    23         void build(Setting &S, void** ret) const{ 
     23        void build(Setting &S, bdmroot* &ret) const{ 
    2424                try{ 
    2525                        int a=S["a"]; 
     
    2727                        S.lookupValue("S",St); 
    2828                        cls* tmp = new cls(a,St); 
    29                         *ret=tmp; 
     29                        ret=tmp; 
    3030                } 
    3131                catch (...){ 
     
    3838        public: 
    3939        UItest2():UIbuilder("test2"){} 
    40         void build(Setting &S, void** ret) const{ 
     40        void build(Setting &S, bdmroot* &ret) const{ 
    4141                try{ 
    4242                        int a=S["a"]; 
     
    4444                        S.lookupValue("S",St); 
    4545                        cls* tmp = new cls2(a,St); 
    46                         *ret=tmp; 
     46                        ret=tmp; 
    4747                } 
    4848                catch (...){ 
     
    5959 
    6060int main(){ 
    61  
    6261UIFile UI("UIbuilder_test.cfg"); 
    6362 
    6463cls* Cls; 
    65 UIbuild(UI.lookup("test"),&Cls); 
     64UIbuild(UI.lookup("test"),Cls); 
    6665cls* Cls2; 
    67 UIbuild(UI.lookup("test2"),&Cls2); 
     66UIbuild(UI.lookup("test2"),Cls2); 
    6867cls* Cls3; 
    69 UIbuild(UI.lookup("test3"),&Cls3); 
     68UIbuild(UI.lookup("test3"),Cls3); 
    7069 
    7170Cls->print(); 
    7271Cls2->print(); 
    73 Cls3->print(); 
    74 return 0; 
     72Cls3->print();  
     73 
     74delete Cls; 
     75delete Cls2; 
     76delete Cls3; 
    7577}