11 #ifndef TEST_INTERFACE_OBSAUXINCREMENT_H_ 12 #define TEST_INTERFACE_OBSAUXINCREMENT_H_ 18 #define BOOST_TEST_NO_MAIN 19 #define BOOST_TEST_ALTERNATIVE_INIT_API 20 #define BOOST_TEST_DYN_LINK 22 #include <boost/test/unit_test.hpp> 24 #include <boost/noncopyable.hpp> 25 #include <boost/scoped_ptr.hpp> 27 #include "eckit/config/LocalConfiguration.h" 32 #include "oops/util/DateTime.h" 33 #include "oops/util/dot_product.h" 52 return theObsAuxIncrementFixture;
62 boost::scoped_ptr<const eckit::LocalConfiguration>
conf_;
63 boost::scoped_ptr<const Covariance_>
covar_;
72 AuxIncr_ dx(Test_::config());
74 BOOST_CHECK_EQUAL(dx.norm(), 0.0);
83 AuxIncr_ dx1(Test_::config());
87 BOOST_CHECK(dx2.norm() > 0.0);
88 BOOST_CHECK_EQUAL(dx2.norm(), dx1.norm());
92 BOOST_CHECK_EQUAL(dx2.norm(), 0.0);
101 AuxIncr_ dx1(Test_::config());
104 AuxIncr_ dx2(dx1, Test_::config());
105 BOOST_CHECK(dx2.norm() > 0.0);
106 BOOST_CHECK_EQUAL(dx2.norm(), dx1.norm());
110 BOOST_CHECK_EQUAL(dx2.norm(), 0.0);
119 AuxIncr_ dx1(Test_::config());
121 AuxIncr_ dx2(Test_::config());
125 double dot1 = dx1.norm();
126 BOOST_CHECK(dot1 > 0.0);
128 double dot2 = dx2.norm();
129 BOOST_CHECK(dot2 > 0.0);
132 double dot3 = dx2.norm();
133 BOOST_CHECK(dot3 > 0.0);
135 BOOST_CHECK(dot3 <= dot1 + dot2);
144 AuxIncr_ dx1(Test_::config());
153 BOOST_CHECK_SMALL(dx2.norm(), 1
e-8);
162 AuxIncr_ dx1(Test_::config());
164 AuxIncr_ dx2(Test_::config());
168 double zz1 = dot_product(dx1, dx2);
169 double zz2 = dot_product(dx2, dx1);
171 BOOST_CHECK_EQUAL(zz1, zz2);
180 AuxIncr_ dx(Test_::config());
182 BOOST_CHECK(dx.norm() > 0.0);
186 BOOST_CHECK_EQUAL(dx.norm(), 0.0);
195 AuxIncr_ dx1(Test_::config());
206 BOOST_CHECK_SMALL(dx2.norm(), 1
e-8);
219 boost::unit_test::test_suite * ts = BOOST_TEST_SUITE(
"interface/ObsAuxIncrement");
221 ts->add(BOOST_TEST_CASE(&testObsAuxIncrementConstructor<MODEL>));
222 ts->add(BOOST_TEST_CASE(&testObsAuxIncrementCopyConstructor<MODEL>));
223 ts->add(BOOST_TEST_CASE(&testObsAuxIncrementChangeRes<MODEL>));
224 ts->add(BOOST_TEST_CASE(&testObsAuxIncrementTriangle<MODEL>));
225 ts->add(BOOST_TEST_CASE(&testObsAuxIncrementOpPlusEq<MODEL>));
226 ts->add(BOOST_TEST_CASE(&testObsAuxIncrementDotProduct<MODEL>));
227 ts->add(BOOST_TEST_CASE(&testObsAuxIncrementAxpy<MODEL>));
229 boost::unit_test::framework::master_test_suite().add(ts);
237 #endif // TEST_INTERFACE_OBSAUXINCREMENT_H_ void testObsAuxIncrementDotProduct()
static const eckit::Configuration & config()
virtual ~ObsAuxIncrement()
void testObsAuxIncrementConstructor()
void testObsAuxIncrementTriangle()
static const eckit::Configuration & config()
void testObsAuxIncrementAxpy()
real(fp), parameter, public e
std::string testid() const
static const Covariance_ & covariance()
boost::scoped_ptr< const Covariance_ > covar_
static ObsAuxIncrementFixture< MODEL > & getInstance()
void testObsAuxIncrementOpPlusEq()
void testObsAuxIncrementCopyConstructor()
void testObsAuxIncrementZero()
void randomize(ObsAuxIncrement_ &) const
oops::ObsAuxControl< MODEL > ObsAux_
void register_tests() const
oops::ObsAuxCovariance< MODEL > Covariance_
boost::scoped_ptr< const eckit::LocalConfiguration > conf_
void testObsAuxIncrementChangeRes()
oops::ObsAuxIncrement< MODEL > AuxIncr_