8 #ifndef TEST_INTERFACE_OBSCHECK_H_ 9 #define TEST_INTERFACE_OBSCHECK_H_ 14 #define BOOST_TEST_NO_MAIN 15 #define BOOST_TEST_ALTERNATIVE_INIT_API 16 #define BOOST_TEST_DYN_LINK 17 #include <boost/test/unit_test.hpp> 19 #include <boost/noncopyable.hpp> 20 #include <boost/scoped_ptr.hpp> 22 #include "eckit/config/LocalConfiguration.h" 37 typedef ObsTestsFixture<MODEL> Test_;
40 for (std::size_t jj = 0; jj < Test_::obspace().size(); ++jj) {
41 boost::scoped_ptr<ObsCheck_> oc(
new ObsCheck_(Test_::obspace()[jj]));
42 BOOST_CHECK(oc.get());
45 BOOST_CHECK(!oc.get());
60 std::vector<eckit::LocalConfiguration>
conf;
61 obsconf.get(
"ObsTypes",
conf);
63 for (std::size_t jj = 0; jj < Test_::obspace().size(); ++jj) {
64 ObsOperator_ hop(Test_::obspace()[jj]);
65 eckit::LocalConfiguration gconf(
conf[jj],
"GeoVaLs");
66 const GeoVaLs_ gval(gconf, hop.variables());
68 eckit::LocalConfiguration biasConf;
69 conf[jj].get(
"ObsBias", biasConf);
70 const ObsAuxCtrl_ ybias(biasConf);
72 ObsVector_ ovec(Test_::obspace()[jj]);
74 const eckit::LocalConfiguration oconf(
conf[jj],
"GeoVaLs");
75 ObsCheck_ ocheck(oconf);
76 ocheck.priorFilter(Test_::obspace()[jj]);
78 hop.simulateObs(gval, ovec, ybias);
80 ocheck.postFilter(gval, ovec, Test_::obspace()[jj]);
82 const double tol = 1.0e-8;
83 const double zz = ovec.rms();
84 const double xx =
conf[jj].getDouble(
"rmsequiv");
86 oops::Log::trace() <<
"ObsCheck check filter zz = " << zz <<
" and xx " <<std::endl;
101 boost::unit_test::test_suite * ts = BOOST_TEST_SUITE(
"interface/ObsCheck");
103 ts->add(BOOST_TEST_CASE(&testConstructor<MODEL>));
104 ts->add(BOOST_TEST_CASE(&testObsCheck<MODEL>));
106 boost::unit_test::framework::master_test_suite().add(ts);
114 #endif // TEST_INTERFACE_OBSCHECK_H_
static const eckit::Configuration & config()
std::string testid() const
void register_tests() const