Changeset 598 for library/tests

Show
Ignore:
Timestamp:
09/03/09 00:27:23 (15 years ago)
Author:
smidl
Message:

new buffered datalink ( #32 ) and new datasources - all with minor trivial tests

Location:
library/tests
Files:
3 added
3 modified

Legend:

Unmodified
Added
Removed
  • library/tests/CMakeLists.txt

    r586 r598  
    3939 
    4040# using UnitTest++ 
    41 add_executable(testsuite datalink_test.cpp egiw_test.cpp emix_test.cpp epdf_test.cpp logger_test.cpp LQG_test.cpp merger_test.cpp  
     41add_executable(testsuite datalink_test.cpp  datasource_test.cpp egiw_test.cpp emix_test.cpp epdf_test.cpp logger_test.cpp LQG_test.cpp merger_test.cpp  
    4242        mpdf_test.cpp randun_test.cpp rectangular_support_test.cpp rv_test.cpp shared_ptr_test.cpp square_mat_test.cpp testsuite.cpp user_info_test.cpp) 
    4343target_link_libraries(testsuite testutil unittest) 
  • library/tests/datalink_test.cpp

    r545 r598  
    8787        } 
    8888} 
     89 
     90TEST ( test_datalink_buffered ) { 
     91        RV a = RV ( "{dl_a }" ); 
     92        RV b = RV ( "{dlb }" ); 
     93        RV ab=concat(a,b); 
     94        RV aa = a; 
     95        a.t(-1); 
     96        aa.add(a);  
     97 
     98         
     99        datalink_buffered dl; 
     100        dl.set_connection ( concat(aa,b), ab); 
     101 
     102        vec val_up ( "1 2" ); 
     103        dl.step(val_up); 
     104        val_up="3 4"; 
     105         
     106         
     107        vec p = dl.pushdown ( val_up ); 
     108        vec exp_p = " 3, 1, 4 "; 
     109        CHECK_EQUAL ( exp_p, p ); 
     110 
     111} 
  • library/tests/epdf_harness.cpp

    r536 r598  
    8181                // test of pdflog at zero 
    8282                vec zero ( 0 ); 
    83                 vec zeron ( hepdf->dimension() ); 
    84                 for ( int i = 0; i < zeron.size(); ++i ) { 
    85                         zeron ( i ) = 0; 
    86                 } 
     83                vec zeron=zeros ( hepdf->dimension() ); 
    8784 
    8885                double lpz = hepdf->evallog ( zeron ); 
    89                 CHECK_CLOSE_EX ( lpz, mEp.evallogcond ( zeron, zero ), tolerance ); 
     86                double lpzc=mEp.evallogcond ( zeron, zero ); 
     87                CHECK_CLOSE_EX ( lpz, lpzc, tolerance ); 
    9088 
    9189                vec lpzv(1);