From e2b2f8b9a395a235e26e4b449b3498a2c0410f8f Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Thu, 29 Jun 2023 10:48:32 +0200 Subject: c++,codec-json: Added Struct decoding --- tests/codec-json.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tests/codec-json.cpp') 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 native; data 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"){ -- cgit v1.2.3