11 #ifndef TEST_INTERFACE_GEOMETRYITERATOR_H_ 12 #define TEST_INTERFACE_GEOMETRYITERATOR_H_ 18 #define BOOST_TEST_NO_MAIN 19 #define BOOST_TEST_ALTERNATIVE_INIT_API 20 #define BOOST_TEST_DYN_LINK 21 #include <boost/test/unit_test.hpp> 23 #include <boost/noncopyable.hpp> 24 #include <boost/scoped_ptr.hpp> 26 #include "eckit/config/Configuration.h" 45 return theGeometryIteratorFixture;
54 boost::scoped_ptr<const eckit::LocalConfiguration>
conf_;
62 const eckit::LocalConfiguration
64 Geometry_ geom(geomConfig);
66 boost::scoped_ptr<GeometryIterator_> iter(
new GeometryIterator_(geom.begin()));
67 BOOST_CHECK(iter.get());
70 BOOST_CHECK(!iter.get());
80 const eckit::LocalConfiguration
86 Geometry_ geom(geomConfig);
89 const double rms_conf = stateConfig.getDouble(
"rms");
90 const double tol = stateConfig.getDouble(
"tolerance");
94 for (GeometryIterator_
i = geom.begin();
i != geom.end(); ++
i, ++
n) {
97 std::vector<double> vals = gp.
getVals();
98 rms += std::inner_product(vals.begin(), vals.end(), vals.begin(), 0.) /
106 BOOST_CHECK_CLOSE(rms, rms_conf,
tol);
119 boost::unit_test::test_suite * ts = BOOST_TEST_SUITE(
"interface/GeometryIterator");
121 ts->add(BOOST_TEST_CASE(&testConstructor<MODEL>));
122 ts->add(BOOST_TEST_CASE(&testIterator<MODEL>));
124 boost::unit_test::framework::master_test_suite().add(ts);
132 #endif // TEST_INTERFACE_GEOMETRYITERATOR_H_ l_size ! loop over number of fields ke do je do i
const std::vector< double > getVals()
static const eckit::Configuration & getConfig()
~GeometryIteratorFixture()
virtual ~GeometryIterator()
void register_tests() const
Encapsulates the model state.
std::string testid() const
static const eckit::Configuration & config()
GeometryIteratorFixture()
boost::scoped_ptr< const eckit::LocalConfiguration > conf_
type(var_state_type), dimension(2) state
static GeometryIteratorFixture< MODEL > & getInstance()