From 6352e8e3196f78388b6c771073f9e03eaa612673 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 20 Jun 2023 14:33:09 +1000 Subject: everything everywhere all at once --- source/test/serialization_test.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 source/test/serialization_test.cpp (limited to 'source/test/serialization_test.cpp') diff --git a/source/test/serialization_test.cpp b/source/test/serialization_test.cpp new file mode 100644 index 0000000..2caa034 --- /dev/null +++ b/source/test/serialization_test.cpp @@ -0,0 +1,28 @@ +#include "StarDataStreamDevices.hpp" + +#include "gtest/gtest.h" + +using namespace Star; + +template +void testMap(T const& map) { + auto byteArray = DataStreamBuffer::serializeMapContainer(map); + auto mapOut = DataStreamBuffer::deserializeMapContainer(byteArray); + EXPECT_EQ(map, mapOut); +} + +TEST(DataStreamTest, All) { + Map map1 = { + {1, 2}, {3, 4}, {5, 6}, + }; + + Map map2 = { + {"asdf", 1}, {"asdf1", 2}, {"omg", 2}, + }; + + Map map3 = {}; + + testMap(map1); + testMap(map2); + testMap(map3); +} -- cgit v1.2.3