Changeset 439

Show
Ignore:
Timestamp:
07/28/09 16:44:38 (15 years ago)
Author:
vbarta
Message:

split epdf_harness to common base & testing specific to a particular class

Location:
library/tests
Files:
2 added
3 modified

Legend:

Unmodified
Added
Removed
  • library/tests/CMakeLists.txt

    r436 r439  
    77link_directories (./unittest-cpp) 
    88 
    9 add_library(testutil epdf_harness.cpp epdf_harness.h mat_checks.cpp mat_checks.h test_util.cpp test_util.h) 
     9add_library(testutil egiw_harness.cpp egiw_harness.h epdf_harness.cpp epdf_harness.h mat_checks.cpp mat_checks.h test_util.cpp test_util.h) 
    1010target_link_libraries(testutil bdm itpp unittest) 
    1111 
  • library/tests/epdf_harness.cpp

    r436 r439  
    4444    UI::get(mean, set, "mean"); 
    4545    UI::get(variance, set, "variance"); 
    46     UI::get(lognc, set, "lognc"); 
    4746    UI::get(support, set, "support"); 
    4847 
     
    6362    CHECK_CLOSE(mean, num_mean2(hepdf.get(), xb, yb, nsamples, nsamples), 0.1); 
    6463    CHECK_CLOSE(integral, normcoef(hepdf.get(), xb, yb, nsamples, nsamples), 0.1); 
    65  
    66     egiw *wide = dynamic_cast<egiw *>(hepdf.get()); 
    67     CHECK(wide); 
    68  
    69     CHECK_CLOSE(lognc, wide->lognc(), epsilon); 
    7064} 
    7165 
  • library/tests/epdf_harness.h

    r436 r439  
    3131    vec mean; 
    3232    vec variance; 
    33     double lognc; 
    3433    mat support; 
    3534    int nsamples; 
     
    3736 
    3837public: 
    39     epdf_harness():lognc(0), nsamples(100), integral(0) { } 
     38    epdf_harness():nsamples(100), integral(0) { } 
    4039 
    41     void test(); 
     40    virtual void test(); 
    4241 
    4342    void from_setting(const Setting &set); 
     43 
     44protected: 
     45    epdf *get_epdf() { return hepdf.get(); } 
    4446}; 
    4547