summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2023-11-09 17:02:40 +0100
committerClaudius "keldu" Holeksa <mail@keldu.de>2023-11-09 17:02:40 +0100
commitf40fe73cbd8f61be11721babb1e3615326466041 (patch)
tree7fdbc7a66c52215a35081dbbbcb5955916dc5593 /tests
parentd206499057ceaf6927be4fbc3f54e25dacd83034 (diff)
codec-netcdf: Changed to memory parsing
Diffstat (limited to 'tests')
-rw-r--r--tests/codec-netcdf.cpp33
-rw-r--r--tests/data/array.ncbin156 -> 0 bytes
-rw-r--r--tests/data/primitive.ncbin112 -> 0 bytes
3 files changed, 31 insertions, 2 deletions
diff --git a/tests/codec-netcdf.cpp b/tests/codec-netcdf.cpp
index 72fc5ea..11e53c3 100644
--- a/tests/codec-netcdf.cpp
+++ b/tests/codec-netcdf.cpp
@@ -14,10 +14,39 @@ using TestArrayStruct = Struct<
>;
}
+std::array<uint8_t,112> tests_data_primitive_nc = {
+ 0x43, 0x44, 0x46, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04,
+ 0x64, 0x61, 0x74, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04,
+ 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x05, 0x6f, 0x74, 0x68, 0x65,
+ 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x05, 0x40, 0x40, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00
+};
+
+std::array<uint8_t,156> tests_data_array_nc = {
+ 0x43, 0x44, 0x46, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a,
+ 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x78, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x79, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04,
+ 0x64, 0x61, 0x74, 0x61, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x60,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02,
+ 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05,
+ 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x0b,
+ 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0e
+};
+
SAW_TEST("NetCDF Struct Primitive read"){
using namespace saw;
- data<schema::TestStruct, encode::Netcdf> netcdf{"./data/primitive.nc"};
+ data<schema::TestStruct, encode::Netcdf> netcdf{tests_data_primitive_nc};
data<schema::TestStruct, encode::Native> native;
@@ -32,7 +61,7 @@ SAW_TEST("NetCDF Struct Primitive read"){
SAW_TEST("NetCDF Struct Array read"){
using namespace saw;
- data<schema::TestArrayStruct, encode::Netcdf> netcdf{"./data/array.nc"};
+ data<schema::TestArrayStruct, encode::Netcdf> netcdf{tests_data_array_nc};
data<schema::TestArrayStruct, encode::Native> native;
diff --git a/tests/data/array.nc b/tests/data/array.nc
deleted file mode 100644
index 2155846..0000000
--- a/tests/data/array.nc
+++ /dev/null
Binary files differ
diff --git a/tests/data/primitive.nc b/tests/data/primitive.nc
deleted file mode 100644
index ab49e3b..0000000
--- a/tests/data/primitive.nc
+++ /dev/null
Binary files differ