diff options
Diffstat (limited to 'tests/codec-netcdf.cpp')
-rw-r--r-- | tests/codec-netcdf.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/codec-netcdf.cpp b/tests/codec-netcdf.cpp new file mode 100644 index 0000000..df0037b --- /dev/null +++ b/tests/codec-netcdf.cpp @@ -0,0 +1,25 @@ +#include <forstio/test/suite.h> +#include <forstio/codec/netcdf/netcdf.h> + +namespace { +namespace schema { +using namespace saw::schema; +using TestStruct = Struct< + Member<Int32, "rh"> +>; +} + +SAW_TEST("NetCDF read"){ + using namespace saw; + + data<TestStruct, encode::Netcdf> net{"./data/simple.nc"}; + + data<TestStruct, encode::KelSimple> kel; + + codec<TestStruct, encode::Netcdf> codec; + + auto eov = codec.decode(net, kel); + SAW_EXPECT(eov.is_value(), "Decoding failed"); + SAW_EXPECT(kel.get<"rh">.get() == 5, "Value incorrect"); +} +} |