Show
Ignore:
Timestamp:
11/13/09 09:15:50 (15 years ago)
Author:
mido
Message:

stresssuite - halfway point

Location:
library/tests/testsuite
Files:
6 modified
3 moved

Legend:

Unmodified
Added
Removed
  • library/tests/testsuite/CMakeLists.txt

    r717 r721  
    11# using UnitTest++ 
    22 
    3 SET(unit_test_configurations egiw.cfg mlnorm.cfg edirich.cfg mprod.cfg generator.cfg epdfds.cfg pdfds.cfg user_info_valid.cfg merger.cfg  egamma.cfg user_info_external.cfg   user_info_valid.cfg user_info_erroneous.cfg merger_error.cfg mgamma.cfg enorm.cfg mmix.cfg emix.cfg) 
     3SET(unit_test_configurations egiw.cfg mlnorm.cfg edirich.cfg mprod.cfg generator.cfg epdfds.cfg pdfds.cfg user_info_valid.cfg merger.cfg  egamma.cfg user_info_external.cfg   user_info_valid.cfg user_info_matrix.cfg user_info_erroneous.cfg merger_error.cfg mgamma.cfg enorm.cfg mmix.cfg emix.cfg) 
    44 
    55add_executable(testsuite arx_straux_test.cpp datalink_test.cpp  datasource_test.cpp egiw_test.cpp emix_test.cpp epdf_test.cpp logger_test.cpp LQG_test.cpp merger_test.cpp pdf_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  ${unit_test_configurations} ) 
  • library/tests/testsuite/emix_test.cpp

    r717 r721  
    44#include "UnitTest++.h" 
    55#include "../test_util.h" 
     6#include "../pdf_harness.h" 
     7 
    68 
    79const double epsilon = 0.00001; 
     
    1214 
    1315static void check_covariance ( emix &distrib_obj, int nsamples, const mat &R, double tolerance); 
     16 
     17TEST ( emix_test ) { 
     18        pdf_harness::test_config ( "emix.cfg" ); 
     19} 
    1420 
    1521TEST ( emix_1_test ) { 
     
    8894} 
    8995 
    90 TEST ( emix_2_test ) { 
    91         int N = 10000; // number of samples 
    92         vec mu0 ( "1.5 1.7" ); 
    93         mat V0 ( "1.2 0.3; 0.3 5" ); 
    94         ldmat R = ldmat ( V0 ); 
    95  
    96         enorm_ldmat_ptr eN; 
    97         eN->set_parameters ( mu0, R ); 
    98  
    99         vec a = "100000,10000"; 
    100         vec b = a / 10.0; 
    101         egamma_ptr eG; 
    102         eG->set_parameters ( a, b ); 
    103  
    104         emix eMix; 
    105         epdf_array Coms ( 2 ); 
    106         Coms ( 0 ) = eG; 
    107         Coms ( 1 ) = eN; 
    108  
    109         eMix.set_parameters ( vec_2 ( 0.5, 0.5 ), Coms ); 
    110         check_mean ( eMix, N, eMix.mean(), 0.1 ); 
    111 } 
    11296 
    11397static void check_mean ( emix &distrib_obj, int nsamples, const vec &mean, double tolerance ) { 
  • library/tests/testsuite/logger_test.cpp

    r717 r721  
    5454        logger.finalize(); 
    5555 
    56         CHECK_EQUAL ( get_file_size ( "test_log.matrix" ), get_file_size ( ls.c_str() ) ); 
     56        CHECK_EQUAL ( get_file_size ( "logger_test.matrix" ), get_file_size ( ls.c_str() ) ); 
    5757} 
    5858 
     
    8181        L.finalize(); 
    8282 
    83         std::string expected ( load_test_file ( "dirfile-format.matrix" ) ); 
     83        std::string expected ( load_test_file ( "logger_test_dirfile_format.matrix" ) ); 
    8484        std::string actual ( load_test_file ( "exp/dirfile/format" ) ); 
    8585        CHECK_EQUAL ( expected, actual ); 
  • library/tests/testsuite/pdf_test.cpp

    r717 r721  
    88 
    99using namespace bdm; 
    10  
    11 static void check_mean(pdf &distrib_obj, const vec &mu0, int nsamples, const vec &mean, double tolerance); 
    12  
    13 static void check_covariance(mmix &distrib_obj, const vec &mu0, int nsamples, const mat &R, double tolerance); 
    1410 
    1511TEST ( mgamma_test ) { 
     
    2824        pdf_harness::test_config ( "mmix.cfg" ); 
    2925} 
    30  
    31 TEST ( emix_test ) { 
    32         pdf_harness::test_config ( "emix.cfg" ); 
    33 } 
  • library/tests/testsuite/testsuite.cpp

    r717 r721  
    5656                } 
    5757        } else { 
    58                 cout << "usage: " << endl << 
    59                      "\"" << argv[0] << "\" - to run all unit tests " << endl << 
    60                      "\"" << argv[0] << " particular_test_1 particular_test_2\" - to run selected unit tests" << endl << 
    61                      "\"" << argv[0] << " print\" - to print all the implemented unit tests" << endl; 
     58                cout << endl << "TESTSUITE - a program covering all BDM unit tests." << endl << endl  
     59                     << argv[0] << " ....................................... run all unit tests" << endl  
     60                     << argv[0] << " particular_test_1 particular_test_2 ... run selected unit tests" << endl  
     61                     << argv[0] << " print ................................. print all the implemented unit tests" << endl; 
    6262        } 
    6363 
  • library/tests/testsuite/user_info_test.cpp

    r717 r721  
    254254        UI::save ( &author, out, "karlovo" ); 
    255255        UI::save ( pepikovo, out, "pepikovo" ); 
    256         out.save ( "testUI_out.cfg" ); 
    257  
    258         string expected ( load_test_file ( "testUI_out.matrix" ) ); 
    259         string actual ( load_test_file ( "testUI_out.cfg" ) ); 
     256        out.save ( "user_info_output.cfg" ); 
     257 
     258        string expected ( load_test_file ( "user_info_matrix.cfg" ) ); 
     259        string actual ( load_test_file ( "user_info_output.cfg" ) ); 
    260260        CHECK_EQUAL ( expected, actual ); 
    261261}