11 #ifndef TEST_INTERFACE_LOCALIZATION_H_ 12 #define TEST_INTERFACE_LOCALIZATION_H_ 18 #define BOOST_TEST_NO_MAIN 19 #define BOOST_TEST_ALTERNATIVE_INIT_API 20 #define BOOST_TEST_DYN_LINK 22 #include <boost/noncopyable.hpp> 23 #include <boost/scoped_ptr.hpp> 24 #include <boost/test/unit_test.hpp> 26 #include "eckit/config/LocalConfiguration.h" 33 #include "oops/util/DateTime.h" 53 return theLocalizationFixture;
66 oops::instantiateLocalizationFactory<MODEL>();
73 boost::scoped_ptr<const Geometry_>
resol_;
74 boost::scoped_ptr<const oops::Variables>
ctlvars_;
75 boost::scoped_ptr<const util::DateTime>
time_;
76 boost::scoped_ptr<Localization_>
local_;
85 Increment_ dx(Test_::resol(), Test_::ctlvars(),
Test_::time());
87 BOOST_CHECK_EQUAL(dx.norm(), 0.0);
88 Test_::localization().multiply(dx);
89 BOOST_CHECK_EQUAL(dx.norm(), 0.0);
98 Increment_ dx(Test_::resol(), Test_::ctlvars(),
Test_::time());
101 BOOST_CHECK(dx.norm() > 0.0);
102 Test_::localization().multiply(dx);
103 BOOST_CHECK(dx.norm() > 0.0);
116 boost::unit_test::test_suite * ts = BOOST_TEST_SUITE(
"interface/Localization");
118 ts->add(BOOST_TEST_CASE(&testLocalizationZero<MODEL>));
119 ts->add(BOOST_TEST_CASE(&testLocalizationMultiply<MODEL>));
121 boost::unit_test::framework::master_test_suite().add(ts);
129 #endif // TEST_INTERFACE_LOCALIZATION_H_
static LocalizationFixture< MODEL > & getInstance()
boost::scoped_ptr< const Geometry_ > resol_
static const util::DateTime & time()
void testLocalizationZero()
static const oops::Variables & ctlvars()
static const eckit::Configuration & config()
boost::scoped_ptr< Localization_ > local_
std::string testid() const
static const Localization_ & localization()
void register_tests() const
void testLocalizationMultiply()
Increment Class: Difference between two states.
oops::Localization< MODEL > Localization_
boost::scoped_ptr< const util::DateTime > time_
oops::Geometry< MODEL > Geometry_
boost::scoped_ptr< const oops::Variables > ctlvars_
static const Geometry_ & resol()