diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2023-06-29 10:48:32 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2023-06-29 10:48:32 +0200 |
commit | e2b2f8b9a395a235e26e4b449b3498a2c0410f8f (patch) | |
tree | f0fd1487a3d5010a5e4daf3f4f8052a77f82029c /tests/codec-json.cpp | |
parent | 95b870c811032436c209978d0e2fb6ab76707e8e (diff) |
c++,codec-json: Added Struct decoding
Diffstat (limited to 'tests/codec-json.cpp')
-rw-r--r-- | tests/codec-json.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/codec-json.cpp b/tests/codec-json.cpp index 5b4700f..926f550 100644 --- a/tests/codec-json.cpp +++ b/tests/codec-json.cpp @@ -285,7 +285,7 @@ SAW_TEST("Three Dim Array write and read"){ } -SAW_TEST("Struct write"){ +SAW_TEST("Struct read and write"){ using namespace saw; data<schema::TestStruct, encode::Native> native; data<schema::TestStruct, encode::Json> json; @@ -302,13 +302,12 @@ SAW_TEST("Struct write"){ std::string enc_val = convert_to_string(json.get_buffer()); SAW_EXPECT(enc_val == str_v, std::string{"Struct not encoded correctly. Encoded: "} + enc_val + std::string{" Expected: "} + std::string{str_v}); -/* + native = {}; eov = json_codec.decode(json, native); SAW_EXPECT(eov.is_value(), "Decoding error"); SAW_EXPECT(native.get<"foo">().get() == 5, "Invalid value for foo"); SAW_EXPECT(native.get<"bar">() == "baz", "Invalid value for bar"); -*/ } SAW_TEST("Int8 read"){ |