11 #ifndef TEST_INTERFACE_MODELAUXINCREMENT_H_ 12 #define TEST_INTERFACE_MODELAUXINCREMENT_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" 33 #include "oops/util/DateTime.h" 34 #include "oops/util/dot_product.h" 55 return theModelAuxIncrementFixture;
70 boost::scoped_ptr<const eckit::LocalConfiguration>
conf_;
71 boost::scoped_ptr<const Geometry_>
resol_;
72 boost::scoped_ptr<const Covariance_>
covar_;
81 AuxIncr_ dx(Test_::resol(), Test_::config());
83 BOOST_CHECK_EQUAL(dx.norm(), 0.0);
92 AuxIncr_ dx1(Test_::resol(), Test_::config());
96 BOOST_CHECK(dx2.norm() > 0.0);
97 BOOST_CHECK_EQUAL(dx2.norm(), dx1.norm());
101 BOOST_CHECK_EQUAL(dx2.norm(), 0.0);
110 AuxIncr_ dx1(Test_::resol(), Test_::config());
113 AuxIncr_ dx2(dx1, Test_::config());
114 BOOST_CHECK(dx2.norm() > 0.0);
115 BOOST_CHECK_EQUAL(dx2.norm(), dx1.norm());
119 BOOST_CHECK_EQUAL(dx2.norm(), 0.0);
128 AuxIncr_ dx1(Test_::resol(), Test_::config());
130 AuxIncr_ dx2(Test_::resol(), Test_::config());
134 double dot1 = dx1.norm();
135 BOOST_CHECK(dot1 > 0.0);
137 double dot2 = dx2.norm();
138 BOOST_CHECK(dot2 > 0.0);
141 double dot3 = dx2.norm();
142 BOOST_CHECK(dot3 > 0.0);
144 BOOST_CHECK(dot3 <= dot1 + dot2);
153 AuxIncr_ dx1(Test_::resol(), Test_::config());
162 BOOST_CHECK_SMALL(dx2.norm(), 1
e-8);
171 AuxIncr_ dx1(Test_::resol(), Test_::config());
173 AuxIncr_ dx2(Test_::resol(), Test_::config());
177 double zz1 = dot_product(dx1, dx2);
178 double zz2 = dot_product(dx2, dx1);
180 BOOST_CHECK_EQUAL(zz1, zz2);
189 AuxIncr_ dx(Test_::resol(), Test_::config());
191 BOOST_CHECK(dx.norm() > 0.0);
195 BOOST_CHECK_EQUAL(dx.norm(), 0.0);
204 AuxIncr_ dx1(Test_::resol(), Test_::config());
215 BOOST_CHECK_SMALL(dx2.norm(), 1
e-8);
228 boost::unit_test::test_suite * ts = BOOST_TEST_SUITE(
"interface/ModelAuxIncrement");
230 ts->add(BOOST_TEST_CASE(&testModelAuxIncrementConstructor<MODEL>));
231 ts->add(BOOST_TEST_CASE(&testModelAuxIncrementCopyConstructor<MODEL>));
232 ts->add(BOOST_TEST_CASE(&testModelAuxIncrementChangeRes<MODEL>));
233 ts->add(BOOST_TEST_CASE(&testModelAuxIncrementTriangle<MODEL>));
234 ts->add(BOOST_TEST_CASE(&testModelAuxIncrementOpPlusEq<MODEL>));
235 ts->add(BOOST_TEST_CASE(&testModelAuxIncrementDotProduct<MODEL>));
236 ts->add(BOOST_TEST_CASE(&testModelAuxIncrementAxpy<MODEL>));
238 boost::unit_test::framework::master_test_suite().add(ts);
246 #endif // TEST_INTERFACE_MODELAUXINCREMENT_H_
void testModelAuxIncrementCopyConstructor()
void register_tests() const
static const Geometry_ & resol()
boost::scoped_ptr< const Covariance_ > covar_
oops::ModelAuxIncrement< MODEL > AuxIncr_
void randomize(ModelAuxIncrement_ &) const
static const eckit::Configuration & config()
oops::Geometry< MODEL > Geometry_
boost::scoped_ptr< const eckit::LocalConfiguration > conf_
oops::ModelAuxCovariance< MODEL > Covariance_
std::string testid() const
real(fp), parameter, public e
void testModelAuxIncrementChangeRes()
void testModelAuxIncrementZero()
void testModelAuxIncrementDotProduct()
void testModelAuxIncrementTriangle()
static const eckit::Configuration & config()
void testModelAuxIncrementAxpy()
void testModelAuxIncrementConstructor()
static const Covariance_ & covariance()
virtual ~ModelAuxIncrement()
oops::ModelAuxControl< MODEL > ModelAux_
boost::scoped_ptr< const Geometry_ > resol_
void testModelAuxIncrementOpPlusEq()
static ModelAuxIncrementFixture< MODEL > & getInstance()