12 #ifndef TEST_INTERFACE_OBSSPACE_H_
13 #define TEST_INTERFACE_OBSSPACE_H_
18 #define ECKIT_TESTING_SELF_REGISTER_CASES 0
20 #include <boost/noncopyable.hpp>
22 #include "eckit/config/LocalConfiguration.h"
23 #include "eckit/testing/Test.h"
27 #include "oops/util/DateTime.h"
28 #include "oops/util/Duration.h"
37 typedef ObsTestsFixture<OBS> Test_;
39 for (std::size_t jj = 0; jj < Test_::obspace().size(); ++jj) {
40 oops::Log::test() <<
"Testing ObsSpace: " << Test_::obspace()[jj] << std::endl;
41 EXPECT(Test_::obspace()[jj].windowStart() == Test_::tbgn());
42 EXPECT(Test_::obspace()[jj].windowEnd() == Test_::tend());
54 util::DateTime tmid = Test_::tbgn() + (Test_::tend()-Test_::tbgn())/2;
55 oops::Log::test() <<
"Testing subwindows: " << Test_::tbgn() <<
" to " << tmid <<
" and "
56 << tmid <<
" to " << Test_::tend() << std::endl;
57 for (std::size_t jj = 0; jj < Test_::obspace().size(); ++jj) {
58 eckit::LocalConfiguration obsconfig(Test_::config(jj),
"obs space");
63 ObsVector_ ovec(Test_::obspace()[jj]);
64 ObsVector_ ovec1(obspace1);
65 ObsVector_ ovec2(obspace2);
66 oops::Log::test() << Test_::obspace()[jj].obsname() <<
" nobs(all): " << ovec.nobs()
67 <<
" nobs(1st subwindow): " << ovec1.nobs()
68 <<
" nobs(2nd subwindow): " << ovec2.nobs() << std::endl;
69 EXPECT_EQUAL(ovec1.nobs() + ovec2.nobs(), ovec.nobs());
81 std::string
testid()
const override {
return "test::ObsSpace<" +
OBS::name() +
">";}
84 std::vector<eckit::testing::Test>& ts = eckit::testing::specification();
86 ts.emplace_back(
CASE(
"interface/ObsSpace/testConstructor")
87 { testConstructor<OBS>(); });
88 ts.emplace_back(
CASE(
"interface/ObsSpace/testSubwindows")
89 { testSubwindows<OBS>(); });
void register_tests() const override
void clear() const override
ObsTestsFixture< OBS > Test_
std::string testid() const override
const eckit::mpi::Comm & world()
Default communicator with all MPI tasks (ie MPI_COMM_WORLD)
void testSubwindows()
tests that ObsSpaces created on subwindows have the same number obs as ObsSpaces created on the whole...
CASE("assimilation/FullGMRES/FullGMRES")
void testConstructor()
Tests creation and destruction of ObsErrorCovariances.