14 #include <gtest/gtest.h>
19 TEST(Serialization, STL_stdvector)
21 std::vector<uint32_t> m2, m1{1, 2, 3};
32 TEST(Serialization, STL_stdmap)
34 std::map<uint32_t, uint8_t> m2, m1;
48 TEST(Serialization, STL_complex_error_type)
50 std::map<double, std::array<uint8_t, 2>>
v1;
51 std::map<double, std::array<int8_t, 2>>
v2;
61 EXPECT_THROW(arch >>
v2, std::exception);
66 Foo(
int i = 0) : m_i(i) {}
70 bool operator==(const
Foo&
b)
const {
return m_i ==
b.m_i; }
83 TEST(Serialization, vector_custom_type)
85 std::vector<Foo> m2, m1{1, 2, 3};
96 TEST(Serialization, vector_shared_ptr)
98 std::vector<std::shared_ptr<Foo>> m2, m1;
99 m1.push_back(std::make_shared<Foo>(1));
100 m1.push_back(std::make_shared<Foo>(2));
101 m1.push_back(std::shared_ptr<Foo>());
102 m1.push_back(std::make_shared<Foo>(3));
110 EXPECT_EQ(m1.size(), m2.size());
111 for (
auto i = 0U; i < m1.size(); i++)
115 EXPECT_EQ(m1[i], m2[i]);
119 EXPECT_EQ(*m1[i], *m2[i]);