v1.4.4
This commit is contained in:
commit
9c94d113d3
10260 changed files with 1237388 additions and 0 deletions
28
source/test/serialization_test.cpp
Normal file
28
source/test/serialization_test.cpp
Normal file
|
@ -0,0 +1,28 @@
|
|||
#include "StarDataStreamDevices.hpp"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using namespace Star;
|
||||
|
||||
template <typename T>
|
||||
void testMap(T const& map) {
|
||||
auto byteArray = DataStreamBuffer::serializeMapContainer(map);
|
||||
auto mapOut = DataStreamBuffer::deserializeMapContainer<T>(byteArray);
|
||||
EXPECT_EQ(map, mapOut);
|
||||
}
|
||||
|
||||
TEST(DataStreamTest, All) {
|
||||
Map<int, int> map1 = {
|
||||
{1, 2}, {3, 4}, {5, 6},
|
||||
};
|
||||
|
||||
Map<String, int> map2 = {
|
||||
{"asdf", 1}, {"asdf1", 2}, {"omg", 2},
|
||||
};
|
||||
|
||||
Map<String, int> map3 = {};
|
||||
|
||||
testMap(map1);
|
||||
testMap(map2);
|
||||
testMap(map3);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue