59 constexpr int descriptorSize = 8;
61 BOOST_CHECK(TestDescriptorT::size == descriptorSize);
62 BOOST_CHECK(TestDescriptorT::bitcount == descriptorSize * 8);
63 BOOST_CHECK(
sizeof(TestDescriptorT::ItgType) * TestDescriptorT::arraySize == descriptorSize);
64 static_assert(TestDescriptorT::size ==
sizeof(TestDescriptorT),
65 "Descriptor must have size of the underlying data member");
70 constexpr char readable[] =
"DESCRPTR";
72 constexpr TestDescriptorT::ItgType itgvalue = 0x5254505243534544;
74 TestDescriptorT testDescriptor(readable);
75 TestDescriptorT anotherDescriptor(
"ANOTHER");
76 BOOST_CHECK(TestDescriptorT::size ==
sizeof(testDescriptor));
79 BOOST_CHECK(testDescriptor == TestDescriptorT(testDescriptor));
88 anotherDescriptor = testDescriptor;
90 anotherDescriptor = TestDescriptorT(
"SOMEMORE");
94 anotherDescriptor = itgvalue;
98 std::string runtimeString =
"RUNTIMES";
99 TestDescriptorT runtimeDescriptor;
100 runtimeDescriptor.runtimeInit(runtimeString.c_str());
101 BOOST_CHECK(runtimeDescriptor == TestDescriptorT(
"RUNTIMES"));
103 BOOST_CHECK(testDescriptor.as<std::string>().length() == 8);
149 constexpr int descriptorSize = 4;
151 BOOST_CHECK(TestDescriptorT::size == descriptorSize);
152 BOOST_CHECK(TestDescriptorT::bitcount == descriptorSize * 8);
153 BOOST_CHECK(
sizeof(TestDescriptorT::ItgType) * TestDescriptorT::arraySize == descriptorSize);
158 "DataOrigin struct must be of size 4");
166 std::sort(
v1.begin(),
v1.end());
171 std::sort(
v2.begin(),
v2.end());
175 using CustomHeader = std::tuple<DataOrigin, DataDescription>;
176 std::vector<CustomHeader>
v3{CustomHeader{
"TST",
"B"}, CustomHeader{
"TST",
"A"}};
177 std::sort(
v3.begin(),
v3.end());
178 auto h0 = CustomHeader{
"TST",
"A"};
179 auto h1 = CustomHeader{
"TST",
"B"};
183 using CustomHeader2 = std::tuple<DataOrigin, DataDescription, int>;
184 std::vector<CustomHeader2> v4{CustomHeader2{
"TST",
"A", 1}, CustomHeader2{
"TST",
"A", 0}};
185 std::sort(v4.begin(), v4.end());
186 auto hh0 = CustomHeader2{
"TST",
"A", 0};
187 auto hh1 = CustomHeader2{
"TST",
"A", 1};
191 struct CustomHeader3 {
197 std::vector<CustomHeader3> v5{CustomHeader3{
"TST",
"A", 0, 1}, CustomHeader3{
"TST",
"A", 0, 0}};
198 std::sort(v5.begin(), v5.end(), [](CustomHeader3
const& lhs, CustomHeader3
const& rhs) {
199 return std::tie(lhs.origin, lhs.desc, rhs.subSpec, lhs.isOut) < std::tie(rhs.origin, rhs.desc, rhs.subSpec, rhs.isOut);
281 BOOST_CHECK(s2.size() ==
s1.size() +
sizeof(
decltype(meta)));
289 BOOST_CHECK(std::memcmp(get<test::MetaHeader*>(ds2.
data()), &thead,
sizeof(thead)) == 0);
291 auto* h3 = get<test::MetaHeader*>(
s1.data());
293 h3 = get<test::MetaHeader*>(s2.data());
294 BOOST_REQUIRE(h3 !=
nullptr);
296 h1 = get<DataHeader*>(s2.data());
297 BOOST_REQUIRE(h1 !=
nullptr);
303 h3 = get<test::MetaHeader*>(s3.data());
304 BOOST_REQUIRE(h3 !=
nullptr);
312 h3 = get<test::MetaHeader*>(s4.data());
313 BOOST_REQUIRE(h3 !=
nullptr);
317 using namespace boost::container::pmr;
318 Stack s5(new_delete_resource(),
s1.data(),
Stack{}, meta);
321 h3 = get<test::MetaHeader*>(s5.
data());
322 BOOST_REQUIRE(h3 !=
nullptr);
326 auto* h6 = get<DataHeader*>(s5.
data());
327 BOOST_REQUIRE(h5 == h6);
328 BOOST_REQUIRE(h5 !=
nullptr);