13#ifndef RTCTK_COMPONENTFRAMEWORK_TEST_REPOSITORYIFTESTSUITE_HPP
14#define RTCTK_COMPONENTFRAMEWORK_TEST_REPOSITORYIFTESTSUITE_HPP
19#include <gmock/gmock.h>
20#include <gtest/gtest.h>
22#include <fmt/format.h>
50 virtual gsl::span<const char>
MakeSpan()
const {
55 if (shape.size() == 1) {
70 throw std::runtime_error(
"GetShape");
78 throw std::runtime_error(
"MakeSpan");
80 gsl::span<const char>
MakeSpan()
const override {
81 throw std::runtime_error(
"MakeSpan");
89 throw std::runtime_error(
"ResizeBuffer");
125 using ElementType = std::remove_cv_t<typename std::string::value_type>;
150 using ElementType = std::remove_cv_t<typename std::string::value_type>;
176using testing::ContainerEq;
177using testing::IsEmpty;
178using testing::UnorderedElementsAreArray;
180static std::shared_ptr<RepositoryIf> MakeRepository();
186 repo = MakeRepository();
188 for (
unsigned i = 0; i < 10; i++) {
189 std::string name = fmt::format(
"/test/datapoint_{:0>2}", i);
196 if (
repo->DataPointExists(path)) {
197 repo->DeleteDataPoint(path);
204 if constexpr (std::is_same_v<T, std::byte>) {
205 return std::byte{43};
206 }
else if constexpr (std::is_same_v<T, RtcBinary>) {
207 return {std::byte{42}, std::byte{43}};
208 }
else if constexpr (std::is_same_v<T, RtcBool>) {
210 }
else if constexpr (std::is_same_v<T, RtcString>) {
212 }
else if constexpr (std::is_same_v<T, RtcMatrixBool>) {
213 return {1, 3, {
false,
true,
false}};
214 }
else if constexpr (std::is_same_v<T, RtcVectorBool>) {
215 return {
false,
false,
false};
216 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
217 return {1, 2, {
"foo",
"bar"}};
218 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
219 return {
"goo",
"gar"};
220 }
else if constexpr (std::is_arithmetic_v<T>) {
223 return {1, 2, {42, 44}};
232 if constexpr (std::is_same_v<T, std::byte>) {
233 return std::byte{43};
234 }
else if constexpr (std::is_same_v<T, RtcBinary>) {
235 return {std::byte{43}, std::byte{44}, std::byte{45}};
236 }
else if constexpr (std::is_same_v<T, RtcBool>) {
238 }
else if constexpr (std::is_same_v<T, RtcString>) {
240 }
else if constexpr (std::is_same_v<T, RtcMatrixBool>) {
241 return {2, 2, {
true,
false,
true,
false}};
242 }
else if constexpr (std::is_same_v<T, RtcVectorBool>) {
243 return {
true,
true,
true,
true};
244 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
245 return {1, 3, {
"foo",
"bar",
"baz"}};
246 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
247 return {
"goo",
"gar",
"gaz"};
248 }
else if constexpr (std::is_arithmetic_v<T>) {
251 return {1, 3, {43, 44, 45}};
257 template <
typename U>
259 if constexpr (std::is_same_v<U, std::byte>) {
260 return sizeof(value);
261 }
else if constexpr (std::is_arithmetic_v<U>) {
262 return sizeof(value);
271 std::shared_ptr<RepositoryIf>
repo;
325 auto path1 = this->dp_paths[0];
326 auto path2 = this->dp_paths[1];
327 auto& repo = *this->repo;
333 EXPECT_NO_THROW({ exists = repo.DataPointExists(path1); });
334 EXPECT_EQ(exists,
false);
335 EXPECT_NO_THROW({ exists = repo.DataPointExists(path2); });
336 EXPECT_EQ(exists,
false);
337 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/test/subdir/dummy"_dppath); });
338 EXPECT_EQ(exists,
false);
339 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/dummy"_dppath); });
340 EXPECT_EQ(exists,
false);
343 repo.template CreateDataPoint<TypeParam>(path1);
345 EXPECT_NO_THROW({ exists = repo.DataPointExists(path1); });
346 EXPECT_EQ(exists,
true);
347 EXPECT_NO_THROW({ exists = repo.DataPointExists(path2); });
348 EXPECT_EQ(exists,
false);
349 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/test/subdir/dummy"_dppath); });
350 EXPECT_EQ(exists,
false);
351 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/dummy"_dppath); });
352 EXPECT_EQ(exists,
false);
355 repo.template CreateDataPoint<TypeParam>(path2);
357 EXPECT_NO_THROW({ exists = repo.DataPointExists(path1); });
358 EXPECT_EQ(exists,
true);
359 EXPECT_NO_THROW({ exists = repo.DataPointExists(path2); });
360 EXPECT_EQ(exists,
true);
361 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/test/subdir/dummy"_dppath); });
362 EXPECT_EQ(exists,
false);
363 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/dummy"_dppath); });
364 EXPECT_EQ(exists,
false);
367 ASSERT_NO_THROW({ repo.DeleteDataPoint(path1); });
369 EXPECT_NO_THROW({ exists = repo.DataPointExists(path1); });
370 EXPECT_EQ(exists,
false);
371 EXPECT_NO_THROW({ exists = repo.DataPointExists(path2); });
372 EXPECT_EQ(exists,
true);
373 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/test/subdir/dummy"_dppath); });
374 EXPECT_EQ(exists,
false);
375 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/dummy"_dppath); });
376 EXPECT_EQ(exists,
false);
379 ASSERT_NO_THROW({ repo.DeleteDataPoint(path2); });
381 EXPECT_NO_THROW({ exists = repo.DataPointExists(path1); });
382 EXPECT_EQ(exists,
false);
383 EXPECT_NO_THROW({ exists = repo.DataPointExists(path2); });
384 EXPECT_EQ(exists,
false);
385 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/test/subdir/dummy"_dppath); });
386 EXPECT_EQ(exists,
false);
387 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/dummy"_dppath); });
388 EXPECT_EQ(exists,
false);
392 auto path = this->dp_paths[0];
393 auto& repo = *this->repo;
394 auto create_value = this->MakeSomeTestValue();
395 TypeParam read_value;
397 EXPECT_NO_THROW({ repo.DataPointExists(path); });
399 ASSERT_FALSE(repo.DataPointExists(path));
401 repo.CreateDataPoint(path, create_value);
402 ASSERT_TRUE(repo.DataPointExists(path));
404 repo.ReadDataPoint(path, read_value);
405 ASSERT_EQ(create_value, read_value);
407 repo.DeleteDataPoint(path);
408 ASSERT_FALSE(repo.DataPointExists(path));
411 repo.CreateDataPoint(path, create_value);
412 ASSERT_TRUE(repo.DataPointExists(path));
416 auto path = this->dp_paths[0];
417 auto& repo = *this->repo;
418 auto create_value = this->MakeSomeTestValue();
419 auto write_value = this->MakeOtherTestValue();
420 TypeParam read_value;
422 repo.CreateDataPoint(path, create_value);
424 repo.WriteDataPoint(path, write_value);
425 repo.ReadDataPoint(path, read_value);
426 ASSERT_EQ(write_value, read_value);
429 repo.WriteDataPoint(path, create_value);
430 repo.ReadDataPoint(path, read_value);
431 ASSERT_EQ(create_value, read_value);
435 auto path = this->dp_paths[0];
436 auto& repo = *this->repo;
437 const auto create_value = this->MakeSomeTestValue();
438 const auto write_value = this->MakeOtherTestValue();
439 TypeParam read_value;
441 repo.CreateDataPoint(path, create_value);
443 repo.WriteDataPoint(path, write_value);
444 repo.ReadDataPoint(path, read_value);
445 ASSERT_EQ(write_value, read_value);
448 repo.WriteDataPoint(path, create_value);
449 repo.ReadDataPoint(path, read_value);
450 ASSERT_EQ(create_value, read_value);
454 auto path = this->dp_paths[0];
456 auto create_value = this->MakeSomeTestValue();
457 auto write_value = this->MakeOtherTestValue();
462 ASSERT_EQ(write_value, repo.
GetDataPoint<TypeParam>(path));
467 ASSERT_FALSE(repo.
TryGetDataPoint<TypeParam>(
"/non/existing/dp"_dppath).has_value());
471 auto path = this->dp_paths[0];
472 auto& repo = *this->repo;
473 auto create_value = this->MakeSomeTestValue();
475 repo.CreateDataPoint(path, create_value);
477 const auto& type = repo.GetDataPointType(path);
479 EXPECT_EQ(type,
typeid(TypeParam));
483 auto path = this->dp_paths[0];
484 auto& repo = *this->repo;
485 auto create_value = this->MakeSomeTestValue();
486 auto create_value_size = this->GetExpectedSize(create_value);
488 repo.CreateDataPoint(path, create_value);
489 ASSERT_EQ(repo.GetDataPointSize(path), create_value_size);
493 auto path = this->dp_paths[0];
494 auto& repo = *this->repo;
495 auto create_value = this->MakeSomeTestValue();
497 repo.CreateDataPoint(path, create_value);
498 auto shape = repo.GetDataPointShape(path);
500 if constexpr (std::is_same_v<TypeParam, std::byte>) {
501 ASSERT_TRUE(shape.empty());
502 }
else if constexpr (std::is_arithmetic_v<TypeParam>) {
503 ASSERT_TRUE(shape.empty());
505 ASSERT_EQ(shape.size(), 2);
506 ASSERT_EQ(shape[0], create_value.GetNrows());
507 ASSERT_EQ(shape[1], create_value.GetNcols());
509 ASSERT_EQ(shape.size(), 1);
510 ASSERT_EQ(shape[0], create_value.size());
511 }
else if constexpr (std::is_same_v<TypeParam, RtcString>) {
512 ASSERT_EQ(shape.size(), 1);
513 ASSERT_EQ(shape[0], create_value.size());
515 FAIL() <<
"Should never enter here. There is a bug in the test code.";
520 auto path = this->dp_paths[0];
521 auto& repo = *this->repo;
524 auto create_value = this->MakeSomeTestValue();
525 auto write_value = this->MakeOtherTestValue();
526 TypeParam read_value;
534 repo.SendRequest(req).Wait();
536 ASSERT_EQ(exists,
true);
537 ASSERT_EQ(write_value, read_value);
546 repo.SendRequest(req).Wait();
548 ASSERT_EQ(exists,
false);
553 auto path = this->dp_paths[0];
554 auto& repo = *this->repo;
557 const auto create_value = this->MakeSomeTestValue();
558 const auto write_value = this->MakeOtherTestValue();
559 TypeParam read_value;
567 repo.SendRequest(req).Wait();
569 ASSERT_EQ(exists,
true);
570 ASSERT_EQ(write_value, read_value);
579 repo.SendRequest(req).Wait();
581 ASSERT_EQ(exists,
false);
586 auto& repo = *this->repo;
587 auto path_1 = this->dp_paths[0];
588 auto path_2 = this->dp_paths[1];
589 auto create_value_1 = this->MakeSomeTestValue();
590 auto create_value_2 = this->MakeOtherTestValue();
591 auto write_value_1 = create_value_2;
592 auto write_value_2 = create_value_1;
593 TypeParam read_value_1;
594 TypeParam read_value_2;
600 repo.SendRequest(req).Wait();
603 repo.WriteDataPoints(path_1, write_value_1, path_2, write_value_2);
609 repo.SendRequest(req).Wait();
612 ASSERT_EQ(read_value_1, write_value_1);
613 ASSERT_EQ(read_value_2, write_value_2);
617 auto& repo = *this->repo;
618 auto path_1 = this->dp_paths[0];
619 auto path_2 = this->dp_paths[1];
620 auto create_value_1 = this->MakeSomeTestValue();
621 auto create_value_2 = this->MakeOtherTestValue();
622 TypeParam read_value_1;
623 TypeParam read_value_2;
629 repo.SendRequest(req).Wait();
632 repo.ReadDataPoints(path_1, read_value_1, path_2, read_value_2);
634 ASSERT_EQ(read_value_1, create_value_1);
635 ASSERT_EQ(read_value_2, create_value_2);
639 auto path = this->dp_paths[0];
641 auto create_value = this->MakeSomeTestValue();
642 auto write_value = this->MakeOtherTestValue();
643 std::any any_write_value = write_value;
649 std::any any_read_value = repo.
GetDataPoint<std::any>(path);
650 TypeParam& read_value = std::any_cast<TypeParam&>(any_read_value);
651 EXPECT_EQ(write_value, read_value);
657 std::any any_read_value = repo.
TryGetDataPoint<std::any>(path).value();
658 TypeParam& read_value = std::any_cast<TypeParam&>(any_read_value);
659 EXPECT_EQ(write_value, read_value);
664 auto path = this->dp_paths[0];
665 auto& repo = *this->repo;
668 auto create_value = this->MakeSomeTestValue();
669 std::any any_create_value = create_value;
670 repo.CreateDataPoint(path, any_create_value);
672 std::any any_read_value;
673 repo.ReadDataPoint(path, any_read_value);
674 TypeParam& read_value = std::any_cast<TypeParam&>(any_read_value);
675 EXPECT_EQ(create_value, read_value);
679 auto write_value = this->MakeOtherTestValue();
680 std::any any_write_value = write_value;
681 repo.WriteDataPoint(path, any_write_value);
683 std::any any_read_value;
684 repo.ReadDataPoint(path, any_read_value);
685 TypeParam& read_value = std::any_cast<TypeParam&>(any_read_value);
686 EXPECT_EQ(write_value, read_value);
691 auto& repo = *this->repo;
692 auto path_1 = this->dp_paths[0];
693 auto path_2 = this->dp_paths[1];
694 auto create_value_1 = this->MakeSomeTestValue();
695 auto create_value_2 = this->MakeOtherTestValue();
696 auto write_value_1 = create_value_2;
697 auto write_value_2 = create_value_1;
698 TypeParam read_value_1;
699 TypeParam read_value_2;
705 repo.SendRequest(req).Wait();
708 std::any any_write_value_1 = write_value_1;
709 std::any any_write_value_2 = write_value_2;
710 repo.WriteDataPoints(path_1, any_write_value_1, path_2, any_write_value_2);
716 repo.SendRequest(req).Wait();
719 EXPECT_EQ(read_value_1, write_value_1);
720 EXPECT_EQ(read_value_2, write_value_2);
724 auto& repo = *this->repo;
725 auto path_1 = this->dp_paths[0];
726 auto path_2 = this->dp_paths[1];
727 auto create_value_1 = this->MakeSomeTestValue();
728 auto create_value_2 = this->MakeOtherTestValue();
734 repo.SendRequest(req).Wait();
737 std::any any_read_value_1;
738 std::any any_read_value_2;
739 repo.ReadDataPoints(path_1, any_read_value_1, path_2, any_read_value_2);
741 TypeParam& read_value_1 = std::any_cast<TypeParam&>(any_read_value_1);
742 TypeParam& read_value_2 = std::any_cast<TypeParam&>(any_read_value_2);
743 EXPECT_EQ(read_value_1, create_value_1);
744 EXPECT_EQ(read_value_2, create_value_2);
753 if constexpr (std::is_same_v<T, RtcBinary>) {
754 return T(5000, std::byte{43});
755 }
else if constexpr (std::is_same_v<T, RtcString>) {
756 return std::string(5000,
'c');
757 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
758 return T(500, 500, std::vector<std::string>(500 * 500, std::string(
"foo")));
759 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
760 return T(5000, std::string(
"foo"));
762 return {500, 500, std::vector<typename T::value_type>(500 * 500, 42)};
771 if constexpr (std::is_same_v<T, RtcBinary>) {
773 }
else if constexpr (std::is_same_v<T, RtcString>) {
775 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
777 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
789 if constexpr (std::is_same_v<T, RtcBinary>) {
790 return T(2, std::byte{42});
791 }
else if constexpr (std::is_same_v<T, RtcString>) {
792 return std::string(2,
'b');
793 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
794 return T(2, 2, std::vector<std::string>(2 * 2, std::string(
"goo")));
795 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
796 return T(2, std::string(
"goo"));
798 return {2, 2, std::vector<typename T::value_type>(2 * 2, 43)};
807 if constexpr (std::is_same_v<T, RtcBinary>) {
809 }
else if constexpr (std::is_same_v<T, RtcString>) {
811 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
813 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
825 if constexpr (std::is_same_v<T, RtcString>) {
826 return "0123456789abcdef";
827 }
else if constexpr (std::is_same_v<T, RtcBinary>) {
829 return { std::byte{1}, std::byte{2}, std::byte{3}, std::byte{4},
830 std::byte{5}, std::byte{6}, std::byte{7}, std::byte{8},
831 std::byte{9}, std::byte{10}, std::byte{11}, std::byte{12},
832 std::byte{13}, std::byte{14}, std::byte{15}, std::byte{16}};
834 }
else if constexpr (std::is_same_v<T, RtcMatrixBool>) {
836 return {4, 4, {
true,
true,
false,
false,
837 false,
false,
true,
false,
838 false,
false,
false,
true,
839 false,
false,
false,
false}};
841 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
843 return {4, 4, {
"1",
"2",
"3",
"4",
845 "9",
"10",
"11",
"12",
846 "13",
"14",
"15",
"16"}};
848 }
else if constexpr (std::is_same_v<T, RtcVectorBool>) {
850 return {
true,
false,
true,
false,
true,
false,
true,
false,
851 true,
false,
true,
false,
true,
false,
true,
false};
853 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
855 return {
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
856 "9",
"10",
"11",
"12",
"13",
"14",
"15",
"16"};
860 return {4, 4, { 1, 2, 3, 4,
866 return {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
868 static_assert(
false,
"Should never enter here. There is a bug in the test code.");
873 if constexpr (std::is_same_v<T, RtcString>) {
875 }
else if constexpr (std::is_same_v<T, RtcBinary>) {
876 return {std::byte{12}, std::byte{13}, std::byte{14}, std::byte{15}};
877 }
else if constexpr (std::is_same_v<T, RtcMatrixBool>) {
878 return {1, 4, {
false,
false,
true,
true}};
879 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
880 return {1, 4, {
"12",
"13",
"14",
"15"}};
881 }
else if constexpr (std::is_same_v<T, RtcVectorBool>) {
882 return {
true,
true,
true,
true};
883 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
884 return {
"12",
"13",
"14",
"15"};
886 return {1, 4, {12, 13, 14, 15}};
888 return {12, 13, 14, 15};
890 static_assert(
false,
"Should never enter here. There is a bug in the test code.");
895 if constexpr (std::is_same_v<T, RtcString>) {
896 return "abcd456789abcdef";
897 }
else if constexpr (std::is_same_v<T, RtcBinary>) {
899 return {std::byte{12}, std::byte{13}, std::byte{14}, std::byte{15},
900 std::byte{5}, std::byte{6}, std::byte{7}, std::byte{8},
901 std::byte{9}, std::byte{10}, std::byte{11}, std::byte{12},
902 std::byte{13}, std::byte{14}, std::byte{15}, std::byte{16}};
904 }
else if constexpr (std::is_same_v<T, RtcMatrixBool>) {
906 return {4, 4, {
false,
false,
true,
true,
907 false,
false,
true,
false,
908 false,
false,
false,
true,
909 false,
false,
false,
false}};
911 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
913 return {4, 4, {
"12",
"13",
"14",
"15",
915 "9",
"10",
"11",
"12",
916 "13",
"14",
"15",
"16"}};
918 }
else if constexpr (std::is_same_v<T, RtcVectorBool>) {
920 return {
true,
true,
true,
true,
true,
false,
true,
false,
921 true,
false,
true,
false,
true,
false,
true,
false};
923 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
925 return {
"12",
"13",
"14",
"15",
"5",
"6",
"7",
"8",
926 "9",
"10",
"11",
"12",
"13",
"14",
"15",
"16"};
930 return {4, 4, {12, 13, 14, 15,
936 return {12, 13, 14, 15, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
938 static_assert(
false,
"Should never enter here. There is a bug in the test code.");
943 if constexpr (std::is_same_v<T, RtcString>) {
945 }
else if constexpr (std::is_same_v<T, RtcBinary>) {
946 return {std::byte{1}, std::byte{2}, std::byte{3}, std::byte{4}};
947 }
else if constexpr (std::is_same_v<T, RtcMatrixBool>) {
948 return {1, 4, {
true,
true,
false,
false}};
949 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
950 return {1, 4, {
"1",
"2",
"3",
"4"}};
951 }
else if constexpr (std::is_same_v<T, RtcVectorBool>) {
952 return {
true,
false,
true,
false};
953 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
954 return {
"1",
"2",
"3",
"4"};
956 return {1, 4, {1, 2, 3, 4}};
960 static_assert(
false,
"Should never enter here. There is a bug in the test code.");
965 if constexpr (std::is_same_v<T, RtcString>) {
967 }
else if constexpr (std::is_same_v<T, RtcBinary>) {
968 return {std::byte{13}, std::byte{14}, std::byte{15}, std::byte{16}};
969 }
else if constexpr (std::is_same_v<T, RtcMatrixBool>) {
970 return {1, 4, {
false,
false,
false,
false}};
971 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
972 return {1, 4, {
"13",
"14",
"15",
"16"}};
973 }
else if constexpr (std::is_same_v<T, RtcVectorBool>) {
974 return {
true,
false,
true,
false};
975 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
976 return {
"13",
"14",
"15",
"16"};
978 return {1, 4, {13, 14, 15, 16}};
980 return {13, 14, 15, 16};
982 static_assert(
false,
"Should never enter here. There is a bug in the test code.");
989 read_value.resize(result_value.GetNrows(), result_value.GetNcols());
991 read_value.resize(result_value.size());
1027 auto path = this->dp_paths[0];
1028 auto& repo = *this->repo;
1029 auto create_value = this->MakeSomeTestValue();
1030 auto write_value = this->MakeOtherTestValue();
1032 repo.CreateDataPoint(path, create_value);
1033 auto create_shape = repo.GetDataPointShape(path);
1034 repo.WriteDataPoint(path, write_value);
1035 auto write_shape = repo.GetDataPointShape(path);
1037 EXPECT_NE(create_shape, write_shape);
1041 auto path = this->dp_paths[0];
1042 auto& repo = *this->repo;
1044 auto create_value = this->MakeLargeTestValue();
1045 TypeParam read_value;
1050 repo.SendRequest(req).Wait();
1052 ASSERT_EQ(read_value, create_value);
1056 auto path = this->dp_paths[0];
1057 auto& repo = *this->repo;
1059 auto create_value = this->MakeSmallTestValue();
1060 auto write_value = this->MakeLargeTestValue();
1061 auto expected_shape = this->ExpectedLargeTestValueShape();
1062 TypeParam read_value;
1064 auto val = this->MakeLargeTestValue();
1065 EXPECT_EQ(val, write_value);
1071 repo.SendRequest(req).Wait();
1072 EXPECT_EQ(read_value, write_value);
1074 auto shape = repo.GetDataPointShape(path);
1075 EXPECT_EQ(shape, expected_shape);
1079 auto path = this->dp_paths[0];
1080 auto& repo = *this->repo;
1082 auto create_value = this->MakeLargeTestValue();
1083 auto write_value = this->MakeSmallTestValue();
1084 auto expected_shape = this->ExpectedSmallTestValueShape();
1085 TypeParam read_value;
1091 repo.SendRequest(req).Wait();
1092 ASSERT_EQ(read_value, write_value);
1094 auto shape = repo.GetDataPointShape(path);
1095 EXPECT_EQ(shape, expected_shape);
1099 auto path = this->dp_paths[0];
1100 auto& repo = *this->repo;
1102 TypeParam create_value;
1103 TypeParam write_value;
1104 TypeParam read_value_1;
1105 TypeParam read_value_2;
1108 if constexpr (std::is_same_v<TypeParam, RtcBinary>) {
1109 create_value.resize(1, std::byte{42});
1110 expected_shape = {0};
1111 }
else if constexpr (std::is_same_v<TypeParam, RtcMatrixString>) {
1112 create_value.resize(1, 1,
"foo");
1113 expected_shape = {0, 0};
1114 }
else if constexpr (std::is_same_v<TypeParam, RtcVectorString>) {
1115 create_value.resize(1,
"foo");
1116 expected_shape = {0};
1117 }
else if constexpr (std::is_same_v<TypeParam, RtcString>) {
1118 create_value = std::string(1,
'c');
1119 expected_shape = {0};
1121 create_value.resize(1, 1, 42);
1122 expected_shape = {0, 0};
1124 create_value.resize(1, 42);
1125 expected_shape = {0};
1127 FAIL() <<
"Should never enter here. There is a bug in the test code.";
1135 repo.SendRequest(req).Wait();
1136 ASSERT_EQ(read_value_1, create_value);
1137 ASSERT_EQ(read_value_2, write_value);
1139 auto shape = repo.GetDataPointShape(path);
1140 EXPECT_EQ(shape, expected_shape);
1144 auto path = this->dp_paths[0];
1145 auto& repo = *this->repo;
1147 TypeParam create_value;
1148 TypeParam write_value;
1149 TypeParam read_value;
1152 if constexpr (std::is_same_v<TypeParam, RtcBinary>) {
1153 create_value.resize(5000, std::byte{42});
1154 expected_shape = {0};
1155 }
else if constexpr (std::is_same_v<TypeParam, RtcMatrixString>) {
1156 create_value.resize(500, 500,
"foo");
1157 expected_shape = {0, 0};
1158 }
else if constexpr (std::is_same_v<TypeParam, RtcVectorString>) {
1159 create_value.resize(5000,
"foo");
1160 expected_shape = {0};
1161 }
else if constexpr (std::is_same_v<TypeParam, RtcString>) {
1162 create_value = std::string(5000,
'c');
1163 expected_shape = {0};
1165 create_value.resize(500, 500, 42);
1166 expected_shape = {0, 0};
1168 create_value.resize(5000, 42);
1169 expected_shape = {0};
1171 FAIL() <<
"Should never enter here. There is a bug in the test code.";
1178 repo.SendRequest(req).Wait();
1179 ASSERT_EQ(read_value, write_value);
1181 auto shape = repo.GetDataPointShape(path);
1182 EXPECT_EQ(shape, expected_shape);
1186 auto path = this->dp_paths[0];
1187 auto& repo = *this->repo;
1189 TypeParam create_value = this->MakeCreateValueForPartialIo();
1190 TypeParam write_value = this->MakeWriteValueForPartialIo();
1191 TypeParam read_value;
1192 TypeParam result_value = this->MakeExpectedResultValueForPartialWrite();
1198 repo.SendRequest(req).Wait();
1200 EXPECT_EQ(read_value, result_value);
1204 auto path = this->dp_paths[0];
1205 auto& repo = *this->repo;
1209 TypeParam create_value = this->MakeCreateValueForPartialIo();
1210 TypeParam result_value = this->MakeExpectedResultValueForPartialRead();
1211 TypeParam read_value = this->MakeReadValueForPartialIo(result_value);
1216 repo.SendRequest(req).Wait();
1217 EXPECT_EQ(read_value, result_value);
1222 TypeParam result_value = this->MakeExpectedResultValueForPartialReadEnd();
1223 TypeParam read_value = this->MakeReadValueForPartialIo(result_value);
1227 repo.SendRequest(req).Wait();
1228 EXPECT_EQ(read_value, result_value);
1233 auto path = this->dp_paths[0];
1234 auto& repo = *this->repo;
1236 TypeParam create_value = this->MakeCreateValueForPartialIo();
1237 std::any any_write_value = this->MakeWriteValueForPartialIo();
1238 TypeParam read_value;
1239 TypeParam result_value = this->MakeExpectedResultValueForPartialWrite();
1245 repo.SendRequest(req).Wait();
1247 EXPECT_EQ(read_value, result_value);
1251 auto path = this->dp_paths[0];
1252 auto& repo = *this->repo;
1254 TypeParam create_value = this->MakeCreateValueForPartialIo();
1255 TypeParam result_value = this->MakeExpectedResultValueForPartialRead();
1256 std::any any_read_value = this->MakeReadValueForPartialIo(result_value);
1261 repo.SendRequest(req).Wait();
1263 TypeParam& read_value = std::any_cast<TypeParam&>(any_read_value);
1264 EXPECT_EQ(read_value, result_value);
1267template <
typename T>
1277template <
typename T,
typename A>
1284template <
typename T,
typename A>
1291template <
typename A>
1298template <
typename A>
1306 auto path1 = this->dp_paths[0];
1307 auto path2 = this->dp_paths[1];
1308 auto& repo = *this->repo;
1311 BufferType create_value;
1312 BufferType write_value;
1313 BufferType read_value;
1315 if constexpr (std::is_same_v<TypeParam, RtcString>) {
1316 create_value =
"abcd";
1317 write_value =
"1234";
1318 read_value.resize(create_value.size());
1319 }
else if constexpr (std::is_same_v<TypeParam, RtcBinary>) {
1320 create_value = {std::byte{1}, std::byte{2}, std::byte{3}, std::byte{4}};
1321 write_value = {std::byte{11}, std::byte{12}, std::byte{13}, std::byte{14}};
1322 read_value.resize(create_value.size());
1323 }
else if constexpr (std::is_same_v<TypeParam, RtcMatrixBool>) {
1324 create_value = {
true,
true,
false,
false};
1325 write_value = {
false,
false,
true,
true};
1326 read_value.resize(create_value.size());
1327 }
else if constexpr (std::is_same_v<TypeParam, RtcMatrixString>) {
1328 create_value = {2, 2, {
"aa",
"bb",
"cc",
"dd"}};
1329 write_value = {2, 2, {
"00",
"11",
"22",
"33"}};
1330 read_value.resize(create_value.GetNrows(), create_value.GetNcols());
1332 create_value = {2, 2, {1, 2, 3, 4}};
1333 write_value = {2, 2, {11, 12, 13, 14}};
1334 read_value.resize(create_value.GetNrows(), create_value.GetNcols());
1335 }
else if constexpr (std::is_same_v<TypeParam, RtcVectorBool>) {
1336 create_value = {
true,
false,
true,
false};
1337 write_value = {
false,
true,
false,
true};
1338 read_value.resize(create_value.size());
1339 }
else if constexpr (std::is_same_v<TypeParam, RtcVectorString>) {
1340 create_value = {
"aa",
"bb",
"cc",
"dd"};
1341 write_value = {
"00",
"11",
"22",
"33"};
1342 read_value.resize(create_value.size());
1344 create_value = {1, 2, 3, 4};
1345 write_value = {11, 12, 13, 14};
1346 read_value.resize(create_value.size());
1348 FAIL() <<
"Should never enter here. There is a bug in the test code.";
1354 ConstSpanT create_const_span;
1356 ConstSpanT write_const_span;
1359 if constexpr (std::is_same_v<TypeParam, RtcMatrixBool>) {
1360 create_span = SpanT(2, 2, create_value);
1361 create_const_span = ConstSpanT(2, 2, create_value);
1362 write_span = SpanT(2, 2, write_value);
1363 write_const_span = ConstSpanT(2, 2, write_value);
1364 read_span = SpanT(2, 2, read_value);
1366 create_span = SpanT(create_value);
1367 create_const_span = ConstSpanT(create_value);
1368 write_span = SpanT(write_value);
1369 write_const_span = ConstSpanT(write_value);
1370 read_span = SpanT(read_value);
1374 repo.CreateDataPoint(path1, create_span);
1375 ASSERT_EQ(repo.GetDataPointType(path1),
typeid(TypeParam));
1377 repo.ReadDataPoint(path1, read_span);
1378 ASSERT_THAT(read_value, ContainerEq(create_value));
1380 repo.WriteDataPoint(path1, write_span);
1381 repo.ReadDataPoint(path1, read_span);
1382 ASSERT_THAT(read_value, ContainerEq(write_value));
1385 repo.CreateDataPoint(path2, create_const_span);
1386 ASSERT_EQ(repo.GetDataPointType(path2),
typeid(TypeParam));
1388 repo.ReadDataPoint(path2, read_span);
1389 ASSERT_THAT(read_value, ContainerEq(create_value));
1391 repo.WriteDataPoint(path2, write_const_span);
1392 repo.ReadDataPoint(path2, read_span);
1393 ASSERT_THAT(read_value, ContainerEq(write_value));
1395 if constexpr (std::is_same_v<TypeParam, RtcString>) {
1398 auto path3 = this->dp_paths[2];
1399 std::string_view create_view = create_value;
1400 std::string_view write_view = write_value;
1402 repo.CreateDataPoint(path3, create_view);
1403 ASSERT_EQ(repo.GetDataPointType(path3),
typeid(TypeParam));
1405 repo.ReadDataPoint(path3, read_value);
1406 ASSERT_THAT(read_value, ContainerEq(create_value));
1408 repo.WriteDataPoint(path3, write_view);
1409 repo.ReadDataPoint(path3, read_value);
1410 ASSERT_THAT(read_value, ContainerEq(write_value));
1415 auto path = this->dp_paths[0];
1416 auto& repo = *this->repo;
1419 using ArrayType = std::array<typename TypeParam::value_type, 4>;
1420 ArrayType create_array;
1421 ArrayType write_array;
1422 ArrayType read_array;
1423 if constexpr (std::is_same_v<TypeParam, RtcString>) {
1424 create_array = {
'a',
'b',
'c',
'd'};
1425 write_array = {
'1',
'2',
'3',
'4'};
1426 }
else if constexpr (std::is_same_v<TypeParam, RtcBinary>) {
1427 create_array = {std::byte{1}, std::byte{2}, std::byte{3}, std::byte{4}};
1428 write_array = {std::byte{11}, std::byte{12}, std::byte{13}, std::byte{14}};
1429 }
else if constexpr (std::is_same_v<TypeParam, RtcVectorBool>) {
1430 create_array = {
true,
false,
true,
false};
1431 write_array = {
false,
true,
false,
true};
1432 }
else if constexpr (std::is_same_v<TypeParam, RtcVectorString>) {
1433 create_array = {
"aa",
"bb",
"cc",
"dd"};
1434 write_array = {
"00",
"11",
"22",
"33"};
1436 create_array = {1, 2, 3, 4};
1437 write_array = {11, 12, 13, 14};
1440 repo.CreateDataPoint(path, create_array);
1441 ASSERT_EQ(repo.GetDataPointType(path),
typeid(TypeParam));
1443 repo.ReadDataPoint(path, read_array);
1444 ASSERT_EQ(create_array, read_array);
1446 repo.WriteDataPoint(path, write_array);
1447 repo.ReadDataPoint(path, read_array);
1448 ASSERT_EQ(write_array, read_array);
1451 using Row = std::array<typename TypeParam::value_type, 2>;
1452 using MatrixType = std::array<Row, 2>;
1453 MatrixType create_array;
1454 MatrixType write_array;
1455 MatrixType read_array;
1456 if constexpr (std::is_same_v<TypeParam, RtcMatrixBool>) {
1457 create_array = {Row{
true,
false}, Row{
true,
false}};
1458 write_array = {Row{
false,
true}, Row{
false,
true}};
1459 }
else if constexpr (std::is_same_v<TypeParam, RtcMatrixString>) {
1460 create_array = {Row{
"aa",
"bb"}, Row{
"cc",
"dd"}};
1461 write_array = {Row{
"00",
"11"}, Row{
"22",
"33"}};
1463 create_array = {Row{1, 2}, Row{3, 4}};
1464 write_array = {Row{11, 12}, Row{13, 14}};
1467 repo.CreateDataPoint(path, create_array);
1468 ASSERT_EQ(repo.GetDataPointType(path),
typeid(TypeParam));
1470 repo.ReadDataPoint(path, read_array);
1471 ASSERT_EQ(create_array, read_array);
1473 repo.WriteDataPoint(path, write_array);
1474 repo.ReadDataPoint(path, read_array);
1475 ASSERT_EQ(write_array, read_array);
1478 FAIL() <<
"Should never enter here. There is a bug in the test code.";
1483 using testing::ElementsAreArray;
1484 auto path = this->dp_paths[0];
1485 auto& repo = *this->repo;
1488 using ValueType =
typename TypeParam::value_type;
1489 ValueType create_array[4];
1490 ValueType write_array[4];
1491 ValueType read_array[4];
1492 if constexpr (std::is_same_v<TypeParam, RtcString>) {
1493 create_array[0] =
'a';
1494 create_array[1] =
'b';
1495 create_array[2] =
'c';
1496 create_array[3] =
'd';
1497 write_array[0] =
'1';
1498 write_array[1] =
'2';
1499 write_array[2] =
'3';
1500 write_array[3] =
'4';
1501 }
else if constexpr (std::is_same_v<TypeParam, RtcBinary>) {
1502 create_array[0] = std::byte{1};
1503 create_array[1] = std::byte{2};
1504 create_array[2] = std::byte{3};
1505 create_array[3] = std::byte{4};
1506 write_array[0] = std::byte{11};
1507 write_array[1] = std::byte{12};
1508 write_array[2] = std::byte{13};
1509 write_array[3] = std::byte{14};
1510 }
else if constexpr (std::is_same_v<TypeParam, RtcVectorBool>) {
1511 create_array[0] =
true;
1512 create_array[1] =
false;
1513 create_array[2] =
false;
1514 create_array[3] =
true;
1515 write_array[0] =
false;
1516 write_array[1] =
true;
1517 write_array[2] =
true;
1518 write_array[3] =
false;
1519 }
else if constexpr (std::is_same_v<TypeParam, RtcVectorString>) {
1520 create_array[0] =
"aa";
1521 create_array[1] =
"bb";
1522 create_array[2] =
"cc";
1523 create_array[3] =
"dd";
1524 write_array[0] =
"00";
1525 write_array[1] =
"11";
1526 write_array[2] =
"22";
1527 write_array[3] =
"33";
1529 create_array[0] = 1;
1530 create_array[1] = 2;
1531 create_array[2] = 3;
1532 create_array[3] = 4;
1533 write_array[0] = 11;
1534 write_array[1] = 12;
1535 write_array[2] = 13;
1536 write_array[3] = 14;
1539 repo.CreateDataPoint(path, create_array);
1540 ASSERT_EQ(repo.GetDataPointType(path),
typeid(TypeParam));
1542 repo.ReadDataPoint(path, read_array);
1543 gsl::span<ValueType, 4> create_span(std::begin(create_array), std::end(create_array));
1544 EXPECT_THAT(create_span, ElementsAreArray(std::begin(read_array), std::end(read_array)));
1546 repo.WriteDataPoint(path, write_array);
1547 repo.ReadDataPoint(path, read_array);
1548 gsl::span<ValueType, 4> write_span(std::begin(write_array), std::end(write_array));
1549 EXPECT_THAT(write_span, ElementsAreArray(std::begin(read_array), std::end(read_array)));
1552 using ValueType =
typename TypeParam::value_type;
1553 ValueType create_array[2][2];
1554 ValueType write_array[2][2];
1555 ValueType read_array[2][2];
1556 if constexpr (std::is_same_v<TypeParam, RtcMatrixBool>) {
1557 create_array[0][0] =
true;
1558 create_array[0][1] =
false;
1559 create_array[1][0] =
false;
1560 create_array[1][1] =
true;
1561 write_array[0][0] =
false;
1562 write_array[0][1] =
true;
1563 write_array[1][0] =
true;
1564 write_array[1][1] =
false;
1565 }
else if constexpr (std::is_same_v<TypeParam, RtcMatrixString>) {
1566 create_array[0][0] =
"aa";
1567 create_array[0][1] =
"bb";
1568 create_array[1][0] =
"cc";
1569 create_array[1][1] =
"dd";
1570 write_array[0][0] =
"00";
1571 write_array[0][1] =
"11";
1572 write_array[1][0] =
"22";
1573 write_array[1][1] =
"33";
1575 create_array[0][0] = 1;
1576 create_array[0][1] = 2;
1577 create_array[1][0] = 3;
1578 create_array[1][1] = 4;
1579 write_array[0][0] = 11;
1580 write_array[0][1] = 12;
1581 write_array[1][0] = 13;
1582 write_array[1][1] = 14;
1584 gsl::span<ValueType, 2 * 2> read_span(&read_array[0][0], 2 * 2);
1586 repo.CreateDataPoint(path, create_array);
1587 ASSERT_EQ(repo.GetDataPointType(path),
typeid(TypeParam));
1589 repo.ReadDataPoint(path, read_array);
1590 gsl::span<ValueType, 2 * 2> create_span(&create_array[0][0], 2 * 2);
1591 EXPECT_THAT(create_span, ElementsAreArray(read_span.begin(), read_span.end()));
1593 repo.WriteDataPoint(path, write_array);
1594 repo.ReadDataPoint(path, read_array);
1595 gsl::span<ValueType, 2 * 2> write_span(&write_array[0][0], 2 * 2);
1596 EXPECT_THAT(write_span, ElementsAreArray(read_span.begin(), read_span.end()));
1599 FAIL() <<
"Should never enter here. There is a bug in the test code.";
1608 repo = MakeRepository();
1609 path1 =
"/foo"_dppath;
1610 path2 =
"/bar"_dppath;
1611 link1 =
"/link1"_dppath;
1612 link2 =
"/link2"_dppath;
1630 template <
typename T = RtcInt64>
1635 repo->SendRequest(req).Wait();
1639 std::shared_ptr<RepositoryIf>
repo;
1665 EXPECT_CALL(callbacks, CreateCallback(path1)).Times(1);
1666 EXPECT_CALL(callbacks, CreateCallback(path2)).Times(1);
1668 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.CreateCallback(path); };
1675 repo->SendRequest(req).Wait();
1681 EXPECT_CALL(callbacks, DeleteCallback(path1)).Times(1);
1682 EXPECT_CALL(callbacks, DeleteCallback(path2)).Times(1);
1684 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.DeleteCallback(path); };
1691 repo->SendRequest(req).Wait();
1696 bool exists_1, exists_2;
1698 EXPECT_CALL(callbacks, ExistsCallback(path1)).Times(1);
1699 EXPECT_CALL(callbacks, ExistsCallback(path2)).Times(1);
1701 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.ExistsCallback(path); };
1706 repo->SendRequest(req).Wait();
1711 std::pair<RepositoryIf::PathList, RepositoryIf::PathList> children_1, children_2;
1713 EXPECT_CALL(callbacks, GetChildrenCallback(path1)).Times(1);
1714 EXPECT_CALL(callbacks, GetChildrenCallback(path2)).Times(1);
1716 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.GetChildrenCallback(path); };
1721 repo->SendRequest(req).Wait();
1729 EXPECT_CALL(callbacks, WriteCallback(path1)).Times(1);
1730 EXPECT_CALL(callbacks, WriteCallback(path2)).Times(1);
1732 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.WriteCallback(path); };
1739 repo->SendRequest(req).Wait();
1746 EXPECT_CALL(callbacks, ReadCallback(path1)).Times(1);
1747 EXPECT_CALL(callbacks, ReadCallback(path2)).Times(1);
1749 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.ReadCallback(path); };
1756 repo->SendRequest(req).Wait();
1764 EXPECT_CALL(callbacks, PartialWriteCallback(path1)).Times(1);
1765 EXPECT_CALL(callbacks, PartialWriteCallback(path2)).Times(1);
1767 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.PartialWriteCallback(path); };
1773 req.PartialWriteDataPoint(path2, buffer2, 0, 2, 0, std::nullopt, cb);
1774 repo->SendRequest(req).Wait();
1782 EXPECT_CALL(callbacks, PartialReadCallback(path1)).Times(1);
1783 EXPECT_CALL(callbacks, PartialReadCallback(path2)).Times(1);
1785 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.PartialReadCallback(path); };
1791 req.PartialReadDataPoint(path2, buffer2, 0, 2, 0, std::nullopt, cb);
1792 repo->SendRequest(req).Wait();
1798 metadata1[
"comment"] = std::string{
"foo"};
1799 metadata2[
"comment"] = std::string{
"bar"};
1801 EXPECT_CALL(callbacks, WriteMetaDataCallback(path1)).Times(1);
1802 EXPECT_CALL(callbacks, WriteMetaDataCallback(path2)).Times(1);
1804 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.WriteMetaDataCallback(path); };
1811 repo->SendRequest(req).Wait();
1818 EXPECT_CALL(callbacks, ReadMetaDataCallback(path1)).Times(1);
1819 EXPECT_CALL(callbacks, ReadMetaDataCallback(path2)).Times(1);
1821 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.ReadMetaDataCallback(path); };
1828 repo->SendRequest(req).Wait();
1834 EXPECT_CALL(callbacks, CreateSymlinkCallback(link1)).Times(1);
1835 EXPECT_CALL(callbacks, CreateSymlinkCallback(link2)).Times(1);
1837 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.CreateSymlinkCallback(path); };
1844 repo->SendRequest(req).Wait();
1850 EXPECT_CALL(callbacks, UpdateSymlinkCallback(link1)).Times(1);
1851 EXPECT_CALL(callbacks, UpdateSymlinkCallback(link2)).Times(1);
1853 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.UpdateSymlinkCallback(path); };
1863 repo->SendRequest(req).Wait();
1873 testing::InSequence seq;
1874 EXPECT_CALL(callbacks, CreateCallback(path1)).Times(1);
1875 EXPECT_CALL(callbacks, CreateCallback(path2)).Times(1);
1877 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.CreateCallback(path); };
1880 callbacks.CreateCallback(path);
1884 repo->SendRequest(req2).Wait();
1890 repo->SendRequest(req1).Wait();
1900 testing::InSequence seq;
1901 EXPECT_CALL(callbacks, DeleteCallback(path1)).Times(1);
1902 EXPECT_CALL(callbacks, DeleteCallback(path2)).Times(1);
1904 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.DeleteCallback(path); };
1907 callbacks.DeleteCallback(path);
1910 repo->SendRequest(req2).Wait();
1917 repo->SendRequest(req1).Wait();
1924 bool result1, result2;
1928 testing::InSequence seq;
1929 EXPECT_CALL(callbacks, ExistsCallback(path1)).Times(1);
1930 EXPECT_CALL(callbacks, ExistsCallback(path2)).Times(1);
1932 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.ExistsCallback(path); };
1935 callbacks.ExistsCallback(path);
1938 repo->SendRequest(req2).Wait();
1945 repo->SendRequest(req1).Wait();
1953 std::pair<PathList, PathList> result1, result2;
1957 testing::InSequence seq;
1958 EXPECT_CALL(callbacks, GetChildrenCallback(path1)).Times(1);
1959 EXPECT_CALL(callbacks, GetChildrenCallback(path2)).Times(1);
1961 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.GetChildrenCallback(path); };
1964 callbacks.GetChildrenCallback(path);
1967 repo->SendRequest(req2).Wait();
1974 repo->SendRequest(req1).Wait();
1986 testing::InSequence seq;
1987 EXPECT_CALL(callbacks, WriteCallback(path1)).Times(1);
1988 EXPECT_CALL(callbacks, WriteCallback(path2)).Times(1);
1990 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.WriteCallback(path); };
1993 callbacks.WriteCallback(path);
1996 repo->SendRequest(req2).Wait();
2003 repo->SendRequest(req1).Wait();
2014 testing::InSequence seq;
2015 EXPECT_CALL(callbacks, ReadCallback(path1)).Times(1);
2016 EXPECT_CALL(callbacks, ReadCallback(path2)).Times(1);
2018 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.ReadCallback(path); };
2021 callbacks.ReadCallback(path);
2024 repo->SendRequest(req2).Wait();
2031 repo->SendRequest(req1).Wait();
2043 testing::InSequence seq;
2044 EXPECT_CALL(callbacks, WriteCallback(path1)).Times(1);
2045 EXPECT_CALL(callbacks, WriteCallback(path2)).Times(1);
2047 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.WriteCallback(path); };
2050 callbacks.WriteCallback(path);
2053 repo->SendRequest(req2).Wait();
2060 repo->SendRequest(req1).Wait();
2072 testing::InSequence seq;
2073 EXPECT_CALL(callbacks, ReadCallback(path1)).Times(1);
2074 EXPECT_CALL(callbacks, ReadCallback(path2)).Times(1);
2076 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.ReadCallback(path); };
2079 callbacks.ReadCallback(path);
2082 repo->SendRequest(req2).Wait();
2089 repo->SendRequest(req1).Wait();
2097 metadata1[
"comment"] = std::string{
"foo"};
2098 metadata2[
"comment"] = std::string{
"bar"};
2102 testing::InSequence seq;
2103 EXPECT_CALL(callbacks, WriteCallback(path1)).Times(1);
2104 EXPECT_CALL(callbacks, WriteCallback(path2)).Times(1);
2106 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.WriteCallback(path); };
2109 callbacks.WriteCallback(path);
2112 repo->SendRequest(req2).Wait();
2119 repo->SendRequest(req1).Wait();
2130 testing::InSequence seq;
2131 EXPECT_CALL(callbacks, ReadCallback(path1)).Times(1);
2132 EXPECT_CALL(callbacks, ReadCallback(path2)).Times(1);
2134 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.ReadCallback(path); };
2137 callbacks.ReadCallback(path);
2140 repo->SendRequest(req2).Wait();
2147 repo->SendRequest(req1).Wait();
2157 testing::InSequence seq;
2158 EXPECT_CALL(callbacks, CreateSymlinkCallback(link1)).Times(1);
2159 EXPECT_CALL(callbacks, CreateSymlinkCallback(link2)).Times(1);
2161 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.CreateSymlinkCallback(path); };
2164 callbacks.CreateSymlinkCallback(path);
2167 repo->SendRequest(req2).Wait();
2174 repo->SendRequest(req1).Wait();
2185 testing::InSequence seq;
2186 EXPECT_CALL(callbacks, UpdateSymlinkCallback(link1)).Times(1);
2187 EXPECT_CALL(callbacks, UpdateSymlinkCallback(link2)).Times(1);
2189 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.UpdateSymlinkCallback(path); };
2192 callbacks.UpdateSymlinkCallback(path);
2195 repo->SendRequest(req2).Wait();
2202 repo->SendRequest(req0).Wait();
2207 repo->SendRequest(req1).Wait();
2215 repo = MakeRepository();
2216 repo->CreateDataPoint(
"/topdir/datapoint1"_dppath, 0);
2217 repo->CreateDataPoint(
"/topdir/subdir1/datapoint2"_dppath, 0);
2218 repo->CreateDataPoint(
"/topdir/subdir1/datapoint3"_dppath, 0);
2219 repo->CreateDataPoint(
"/topdir/subdir2/datapoint4"_dppath, 0);
2220 repo->CreateDataPoint(
"/topdir/subdir21/datapoint5"_dppath, 0);
2224 if (
repo->DataPointExists(
"/topdir/datapoint1"_dppath)) {
2225 repo->DeleteDataPoint(
"/topdir/datapoint1"_dppath);
2227 if (
repo->DataPointExists(
"/topdir/subdir1/datapoint2"_dppath)) {
2228 repo->DeleteDataPoint(
"/topdir/subdir1/datapoint2"_dppath);
2230 if (
repo->DataPointExists(
"/topdir/subdir1/datapoint2"_dppath)) {
2231 repo->DeleteDataPoint(
"/topdir/subdir1/datapoint2"_dppath);
2233 if (
repo->DataPointExists(
"/topdir/subdir1/datapoint3"_dppath)) {
2234 repo->DeleteDataPoint(
"/topdir/subdir1/datapoint3"_dppath);
2236 if (
repo->DataPointExists(
"/topdir/subdir2/datapoint4"_dppath)) {
2237 repo->DeleteDataPoint(
"/topdir/subdir2/datapoint4"_dppath);
2239 if (
repo->DataPointExists(
"/topdir/subdir21/datapoint5"_dppath)) {
2240 repo->DeleteDataPoint(
"/topdir/subdir21/datapoint5"_dppath);
2245 std::shared_ptr<RepositoryIf>
repo;
2249 auto [dps, paths] = repo->GetChildren(
"/"_dppath);
2250 EXPECT_THAT(dps, IsEmpty());
2251 EXPECT_THAT(paths, UnorderedElementsAreArray({
"/topdir"_dppath}));
2255 auto [dps, paths] = repo->GetChildren(
"/topdir"_dppath);
2256 EXPECT_THAT(dps, UnorderedElementsAreArray({
"/topdir/datapoint1"_dppath}));
2259 UnorderedElementsAreArray(
2260 {
"/topdir/subdir1"_dppath,
"/topdir/subdir2"_dppath,
"/topdir/subdir21"_dppath}));
2264 auto [dps, paths] = repo->GetChildren(
"/topdir/subdir1"_dppath);
2266 UnorderedElementsAreArray(
2267 {
"/topdir/subdir1/datapoint2"_dppath,
"/topdir/subdir1/datapoint3"_dppath}));
2268 EXPECT_THAT(paths, IsEmpty());
2272 auto [dps, paths] = repo->GetChildren(
"/topdir/subdir2"_dppath);
2273 EXPECT_THAT(dps, UnorderedElementsAreArray({
"/topdir/subdir2/datapoint4"_dppath}));
2274 EXPECT_THAT(paths, IsEmpty());
2278 auto [dps, paths] = repo->GetChildren(
"/topdir/datapoint1"_dppath);
2279 EXPECT_THAT(dps, IsEmpty());
2280 EXPECT_THAT(paths, IsEmpty());
2284 auto [dps, paths] = repo->GetChildren(
"/does/not/exist"_dppath);
2285 EXPECT_THAT(dps, IsEmpty());
2286 EXPECT_THAT(paths, IsEmpty());
2290 auto [dps, paths] = repo->GetChildren(
"/"_dppath,
true);
2292 UnorderedElementsAreArray({
"/topdir/datapoint1"_dppath,
2293 "/topdir/subdir1/datapoint2"_dppath,
2294 "/topdir/subdir1/datapoint3"_dppath,
2295 "/topdir/subdir2/datapoint4"_dppath,
2296 "/topdir/subdir21/datapoint5"_dppath}));
2298 UnorderedElementsAreArray({
"/topdir"_dppath,
2299 "/topdir/subdir1"_dppath,
2300 "/topdir/subdir2"_dppath,
2301 "/topdir/subdir21"_dppath}));
2305 repo->DeleteDataPoint(
"/"_dppath,
true);
2307 auto [dps, paths] = repo->GetChildren(
"/"_dppath,
true);
2308 EXPECT_THAT(dps, IsEmpty());
2309 EXPECT_THAT(paths, IsEmpty());
2313 repo->DeleteDataPoint(
"/topdir"_dppath,
true);
2315 auto [dps, paths] = repo->GetChildren(
"/"_dppath,
true);
2316 EXPECT_THAT(dps, IsEmpty());
2317 EXPECT_THAT(paths, IsEmpty());
2321 repo->DeleteDataPoint(
"/topdir/subdir2"_dppath,
true);
2323 auto [dps, paths] = repo->GetChildren(
"/"_dppath,
true);
2325 UnorderedElementsAreArray({
"/topdir/datapoint1"_dppath,
2326 "/topdir/subdir1/datapoint2"_dppath,
2327 "/topdir/subdir1/datapoint3"_dppath,
2328 "/topdir/subdir21/datapoint5"_dppath}));
2330 UnorderedElementsAreArray(
2331 {
"/topdir"_dppath,
"/topdir/subdir1"_dppath,
"/topdir/subdir21"_dppath}));
2339 repo = MakeRepository();
2340 path =
"/foo"_dppath;
2350 std::shared_ptr<RepositoryIf>
repo;
2356 int initial_value = 0;
2359 md[
"timestamp"] = t_start;
2360 md[
"comment"] = std::string{
"some comment"};
2361 md[
"units"] = std::string{
"bar"};
2367 repo->SendRequest(req).Wait();
2369 ASSERT_TRUE(md_read.
Contains(
"type"));
2370 ASSERT_TRUE(md_read.
Contains(
"shape"));
2371 ASSERT_TRUE(md_read.
Contains(
"timestamp"));
2372 ASSERT_TRUE(md_read.
Contains(
"comment"));
2373 ASSERT_TRUE(md_read.
Contains(
"units"));
2375 EXPECT_TRUE(md_read[
"type"].Cast<const std::type_info&>() ==
typeid(
int));
2376 EXPECT_EQ(md_read[
"shape"].Cast<RtcVectorUInt64>(),
RtcVectorUInt64{});
2377 EXPECT_EQ(md_read[
"timestamp"].Cast<RepositoryIf::Timestamp>(), t_start);
2378 EXPECT_EQ(md_read[
"comment"].Cast<std::string>(), std::string{
"some comment"});
2379 EXPECT_EQ(md_read[
"units"].Cast<std::string>(), std::string{
"bar"});
2384 int initial_value = 0;
2387 md[
"timestamp"] = t_start;
2388 md[
"comment"] = std::string{
"some comment"};
2389 md[
"units"] = std::string{
"bar"};
2396 repo->SendRequest(req).Wait();
2398 ASSERT_TRUE(md_read.
Contains(
"timestamp"));
2399 ASSERT_TRUE(md_read.
Contains(
"comment"));
2400 ASSERT_TRUE(md_read.
Contains(
"units"));
2402 EXPECT_EQ(md_read[
"timestamp"].Cast<RepositoryIf::Timestamp>(), t_start);
2403 EXPECT_EQ(md_read[
"comment"].Cast<std::string>(), std::string{
"some comment"});
2404 EXPECT_EQ(md_read[
"units"].Cast<std::string>(), std::string{
"bar"});
2409 int initial_value = 0;
2413 md[
"timestamp"] = t_start;
2414 md[
"comment"] = std::string{
"some comment"};
2415 md[
"units"] = std::string{
"bar"};
2421 repo->SendRequest(req).Wait();
2423 ASSERT_TRUE(md_read.
Contains(
"type"));
2424 ASSERT_TRUE(md_read.
Contains(
"shape"));
2425 ASSERT_TRUE(md_read.
Contains(
"timestamp"));
2426 ASSERT_TRUE(md_read.
Contains(
"comment"));
2427 ASSERT_TRUE(md_read.
Contains(
"units"));
2429 EXPECT_EQ(md_read[
"timestamp"].Cast<RepositoryIf::Timestamp>(), t_start);
2430 EXPECT_EQ(md_read[
"comment"].Cast<std::string>(), std::string{
"some comment"});
2431 EXPECT_EQ(md_read[
"units"].Cast<std::string>(), std::string{
"bar"});
2432 EXPECT_TRUE(md_read[
"type"].Cast<const std::type_info&>() ==
typeid(
int));
2433 EXPECT_EQ(md_read[
"shape"].Cast<RtcVectorUInt64>(),
RtcVectorUInt64{});
2437 int initial_value = 0;
2440 md[
"comment"] = std::string{
"some comment"};
2441 md[
"units"] = std::string{
"bar"};
2448 repo->SendRequest(req).Wait();
2450 ASSERT_TRUE(md_read.
Contains(
"comment"));
2451 ASSERT_TRUE(md_read.
Contains(
"units"));
2453 EXPECT_EQ(md_read[
"comment"].Cast<std::string>(), std::string{
"some comment"});
2454 EXPECT_EQ(md_read[
"units"].Cast<std::string>(), std::string{
"bar"});
2461 metadata[
"min"] =
static_cast<int>(-3);
2462 metadata[
"max"] =
static_cast<int>(3);
2463 metadata[
"text"] = std::string{
"This is a custom text description."};
2468 repo->SendRequest(req).Wait();
2469 ASSERT_TRUE(metadata_read.
Contains(
"min"));
2470 ASSERT_TRUE(metadata_read.
Contains(
"max"));
2471 EXPECT_EQ(metadata_read[
"min"].Cast<int>(), -3);
2472 EXPECT_EQ(metadata_read[
"max"].Cast<int>(), 3);
2473 EXPECT_EQ(metadata_read[
"text"].Cast<std::string>(), metadata[
"text"].Cast<std::string>());
2478 metadata[
"min"] =
static_cast<int>(-5);
2479 metadata[
"max"] =
static_cast<int>(5);
2480 metadata[
"text"] = std::string{
"This is another description."};
2481 metadata[
"new_field"] = std::string{
"A new field added."};
2486 repo->SendRequest(req).Wait();
2487 ASSERT_TRUE(metadata_read.
Contains(
"min"));
2488 ASSERT_TRUE(metadata_read.
Contains(
"max"));
2489 EXPECT_EQ(metadata_read[
"min"].Cast<int>(), -5);
2490 EXPECT_EQ(metadata_read[
"max"].Cast<int>(), 5);
2491 EXPECT_EQ(metadata_read[
"text"].Cast<std::string>(), metadata[
"text"].Cast<std::string>());
2497 metadata[
"min"] =
static_cast<int>(-7);
2498 metadata[
"max"] =
static_cast<int>(7);
2499 metadata[
"text"] = std::string{
"This is a description."};
2500 metadata.
Remove(
"new_field");
2505 repo->SendRequest(req).Wait();
2506 ASSERT_TRUE(metadata_read.
Contains(
"min"));
2507 ASSERT_TRUE(metadata_read.
Contains(
"max"));
2508 EXPECT_EQ(metadata_read[
"min"].Cast<int>(), -7);
2509 EXPECT_EQ(metadata_read[
"max"].Cast<int>(), 7);
2510 EXPECT_EQ(metadata_read[
"text"].Cast<std::string>(), metadata[
"text"].Cast<std::string>());
2517 metadata[
"min"] =
static_cast<int>(-9);
2518 metadata[
"max"] =
static_cast<int>(9);
2519 metadata[
"text"] = std::string{
"A description.\nBut on two lines."};
2520 metadata[
"new_field"] =
static_cast<int>(9);
2525 repo->SendRequest(req).Wait();
2526 ASSERT_TRUE(metadata_read.
Contains(
"min"));
2527 ASSERT_TRUE(metadata_read.
Contains(
"max"));
2528 EXPECT_EQ(metadata_read[
"min"].Cast<int>(), -9);
2529 EXPECT_EQ(metadata_read[
"max"].Cast<int>(), 9);
2530 EXPECT_EQ(metadata_read[
"text"].Cast<std::string>(), metadata[
"text"].Cast<std::string>());
2539 repo = MakeRepository();
2551 if (
repo->DataPointExists(
"/links/foo"_dppath)) {
2552 repo->DeleteDataPoint(
"/links/foo"_dppath);
2554 if (
repo->DataPointExists(
"/links/bar"_dppath)) {
2555 repo->DeleteDataPoint(
"/links/bar"_dppath);
2560 std::shared_ptr<RepositoryIf>
repo;
2570 bool foo_exists =
false;
2571 bool bar_exists =
false;
2572 bool foo_exists_later =
false;
2573 bool bar_exists_later =
false;
2575 repo->CreateDataPoint(target_path, int_create);
2589 repo->SendRequest(req).Wait();
2591 EXPECT_TRUE(foo_exists);
2592 EXPECT_TRUE(bar_exists);
2593 EXPECT_EQ(int_read, 0);
2594 EXPECT_EQ(int_read_2, 4);
2595 EXPECT_FALSE(foo_exists_later);
2596 EXPECT_FALSE(bar_exists_later);
2607 bool exists =
false;
2608 std::set<DataPointPath> links_2;
2623 repo->SendRequest(req).Wait();
2625 EXPECT_FALSE(md_dp.
Contains(
"symlink_target"));
2626 EXPECT_TRUE(md_link.
Contains(
"symlink_target"));
2627 EXPECT_EQ(md_link[
"symlink_target"].Cast<DataPointPath>(),
DataPointPath{
"/foo"});
2629 EXPECT_EQ(int_read, 0);
2630 EXPECT_EQ(int_read_2, 4);
2631 EXPECT_TRUE(exists);
2637 bool link_exists_1 =
false;
2638 bool link_exists_2 =
true;
2646 repo->SendRequest(req).Wait();
2648 EXPECT_TRUE(link_exists_1);
2649 EXPECT_FALSE(link_exists_2);
2655 bool link_exists =
false;
2662 repo->SendRequest(req).Wait();
2665 EXPECT_TRUE(link_exists);
2673 EXPECT_NO_THROW(repo->DeleteDataPoint(link_path));
2679 bool link_exists =
false;
2686 repo->SendRequest(req).Wait();
2689 EXPECT_TRUE(link_exists);
2697 repo->CreateDataPoint(target_path, int_read);
2700 EXPECT_NO_THROW(repo->ReadDataPoint(link_path, int_read));
2705 DataPointPath dangling_target_path =
"/dangling_target"_dppath;
2707 bool link_exists =
false;
2714 repo->SendRequest(req).Wait();
2722 repo->SendRequest(req).Wait();
2725 EXPECT_NO_THROW(repo->ReadDataPoint(link_path, int_read));
2732 repo->SendRequest(req).Wait();
2744 bool link_exists =
false;
2752 repo->SendRequest(req).Wait();
2755 EXPECT_TRUE(link_exists);
2767 repo = MakeRepository();
2768 path =
"/foo"_dppath;
2786 std::shared_ptr<RepositoryIf>
repo;
2805 auto invalid_path =
"relative/dp/path"_dppath;
2832 auto create_value = 42;
2834 ASSERT_FALSE(repo->DataPointExists(path));
2836 repo->CreateDataPoint(path, create_value);
2837 ASSERT_TRUE(repo->DataPointExists(path));
2844 ASSERT_FALSE(repo->DataPointExists(path));
2850 ASSERT_FALSE(repo->DataPointExists(path));
2857 repo->CreateDataPoint(path, int_buffer);
2865 repo->CreateDataPoint(path, int_buffer);
2885 repo->CreateDataPoint(path, int_buffer);
2896 repo->CreateDataPoint(path, write_buffer);
2898 gsl::span<RtcInt64> read_buffer(write_buffer);
2899 auto too_small_read_buffer = read_buffer.subspan(0, 5);
2906 repo->CreateDataPoint(path, write_buffer);
2917 repo->CreateDataPoint(path, write_buffer);
2945 ASSERT_FALSE(repo->DataPointExists(path));
2954 ASSERT_FALSE(repo->DataPointExists(path));
2956 struct UnsupportedMetaDataType {};
2960 UnsupportedMetaDataType new_value;
2962 metadata[
"min"] = std::make_any<UnsupportedMetaDataType>(new_value);
2963 int initial_value = 12;
2966 repo->SendRequest(req).Wait();
2972 ASSERT_FALSE(repo->DataPointExists(path));
2974 repo->CreateDataPoint(path, 12);
2976 struct UnsupportedMetaDataType {};
2980 UnsupportedMetaDataType new_value;
2982 metadata[
"min"] = std::make_any<UnsupportedMetaDataType>(new_value);
2985 repo->SendRequest(req).Wait();
2991 ASSERT_FALSE(repo->DataPointExists(path));
3001 ASSERT_FALSE(repo->DataPointExists(path));
3002 repo->CreateDataPoint(path, 42);
3007 repo->SendRequest(req).Wait();
3016 ASSERT_FALSE(repo->DataPointExists(path));
3017 repo->CreateDataPoint(path, 42);
3025 ASSERT_FALSE(repo->DataPointExists(path));
3026 repo->CreateDataPoint(path, 42);
3032 repo->SendRequest(req).Wait();
3044 int initial_value = 0;
3049 repo->SendRequest(req).Wait();
3053 int write_value = 0;
3068 repo->SendRequest(req).Wait();
3079 bool exists =
false;
3088 repo->SendRequest(req).Wait();
3089 FAIL() <<
"Call did not throw";
3091 const auto& info = ex.
GetInfo();
3092 ASSERT_EQ(info.size(), 4);
3099 EXPECT_EQ(info[0].exception,
nullptr);
3100 ASSERT_NE(info[1].exception,
nullptr);
3101 ASSERT_NE(info[2].exception,
nullptr);
3102 EXPECT_EQ(info[3].exception,
nullptr);
3104 EXPECT_THROW(std::rethrow_exception(info[1].exception),
3106 EXPECT_THROW(std::rethrow_exception(info[2].exception),
3112 FAIL() <<
"Incorrect exception type";
3121 repo = MakeRepository();
3122 for (
unsigned i = 0; i < 500; i++) {
3123 std::string name = fmt::format(
"/test/datapoint_{:0>2}", i);
3129 for (
const auto& path :
dp_paths) {
3130 if (
repo->DataPointExists(path)) {
3131 repo->DeleteDataPoint(path);
3137 std::shared_ptr<RepositoryIf>
repo;
3144 std::vector<std::future<void>> futures;
3146 futures.reserve(dp_paths.size());
3147 for (
unsigned i = 0; i < dp_paths.size(); i++) {
3148 futures.emplace_back(std::async(std::launch::async, [
this, idx = i] {
3149 repo->CreateDataPoint(dp_paths[idx], idx);
3153 for (
auto& f : futures) {
3154 ASSERT_NO_THROW({ f.get(); });
3160 std::vector<std::future<bool>> futures;
3162 futures.reserve(dp_paths.size());
3163 for (
unsigned i = 0; i < dp_paths.size(); i++) {
3164 futures.emplace_back(std::async(std::launch::async, [
this, idx = i] {
3165 return repo->DataPointExists(dp_paths[idx]);
3169 for (
auto& f : futures) {
3170 bool result =
false;
3171 ASSERT_NO_THROW({ result = f.get(); });
3172 ASSERT_TRUE(result);
3178 std::vector<std::future<void>> futures;
3180 futures.reserve(dp_paths.size());
3181 for (
unsigned i = 0; i < dp_paths.size(); i++) {
3182 futures.emplace_back(std::async(std::launch::async, [
this, idx = i] {
3183 repo->SetDataPoint<
unsigned>(dp_paths[idx], idx + 1);
3187 for (
auto& f : futures) {
3188 ASSERT_NO_THROW({ f.get(); });
3194 std::vector<std::future<unsigned>> futures;
3196 futures.reserve(dp_paths.size());
3197 for (
unsigned i = 0; i < dp_paths.size(); i++) {
3198 futures.emplace_back(std::async(std::launch::async, [
this, idx = i] {
3199 return repo->GetDataPoint<
unsigned>(dp_paths[idx]);
3203 for (
unsigned i = 0; i < dp_paths.size(); i++) {
3204 unsigned result = 0;
3205 ASSERT_NO_THROW({ result = futures.at(i).get(); });
3206 EXPECT_EQ(result, i + 1);
3212 std::vector<std::future<void>> futures;
3214 futures.reserve(dp_paths.size());
3215 for (
unsigned i = 0; i < dp_paths.size(); i++) {
3216 futures.emplace_back(std::async(
3217 std::launch::async, [
this, idx = i] { repo->DeleteDataPoint(dp_paths[idx]); }));
3220 for (
auto& f : futures) {
3221 ASSERT_NO_THROW({ f.get(); });
3227 std::vector<std::future<bool>> futures;
3229 futures.reserve(dp_paths.size());
3230 for (
unsigned i = 0; i < dp_paths.size(); i++) {
3231 futures.emplace_back(std::async(std::launch::async, [
this, idx = i] {
3232 return repo->DataPointExists(dp_paths[idx]);
3236 for (
auto& f : futures) {
3238 ASSERT_NO_THROW({ result = f.get(); });
3239 ASSERT_FALSE(result);
3245 auto path = dp_paths[0];
3246 unsigned create_value = 42;
3247 repo->CreateDataPoint(path, create_value);
3250 std::vector<std::future<unsigned>> futures;
3252 futures.reserve(500);
3253 for (
unsigned i = 0; i < 500; i++) {
3254 futures.emplace_back(
3255 std::async(std::launch::async, [&] {
return repo->GetDataPoint<
unsigned>(path); }));
3258 for (
auto& f : futures) {
3260 ASSERT_NO_THROW({ result = f.get(); });
3261 EXPECT_EQ(result, create_value);
3267 auto path = dp_paths[0];
3268 unsigned create_value = 42;
3269 repo->CreateDataPoint(path, create_value);
3272 std::vector<std::future<void>> futures;
3274 futures.reserve(500);
3275 for (
unsigned i = 0; i < 500; i++) {
3276 futures.emplace_back(
3277 std::async(std::launch::async, [&] { repo->SetDataPoint<
unsigned>(path, 43); }));
3280 for (
auto& f : futures) {
3281 ASSERT_NO_THROW({ f.get(); });
3289 repo->SendRequest(req).Wait();
3291 EXPECT_EQ(result, 43);
3292 EXPECT_EQ(md[
"sequence_id"].Cast<RtcUInt64>(), 500);
3296 auto path = dp_paths[0];
3297 unsigned create_value = 42;
3298 repo->CreateDataPoint(path, create_value);
3301 std::vector<std::future<void>> futures;
3303 futures.reserve(50);
3304 for (
unsigned i = 0; i < 50; i++) {
3305 futures.emplace_back(std::async(std::launch::async, [&] {
3306 unsigned buffer = 43;
3308 for (
unsigned j = 0; j < 10; j++) {
3311 repo->SendRequest(req).Wait();
3315 for (
auto& f : futures) {
3316 ASSERT_NO_THROW({ f.get(); });
3324 repo->SendRequest(req).Wait();
3326 EXPECT_EQ(result, 43);
3327 EXPECT_EQ(md[
"sequence_id"].Cast<RtcUInt64>(), 500);
3331 auto path = dp_paths[0];
3332 unsigned create_value = 42;
3333 repo->CreateDataPoint(path, create_value);
3336 std::vector<std::future<unsigned>> futures;
3338 futures.reserve(50);
3339 for (
unsigned i = 0; i < 50; i++) {
3340 futures.emplace_back(std::async(std::launch::async, [&] {
3341 unsigned buffer = 0;
3353 repo->SendRequest(req).Wait();
3358 for (
auto& f : futures) {
3359 unsigned result = 0;
3360 ASSERT_NO_THROW({ result = f.get(); });
3361 EXPECT_EQ(result, 42);
3371 repo = MakeRepository();
3372 for (
unsigned i = 0; i < 500; i++) {
3373 std::string name = fmt::format(
"/test/datapoint_{:0>2}", i);
3379 for (
const auto& path :
dp_paths) {
3380 if (
repo->DataPointExists(path)) {
3381 repo->DeleteDataPoint(path);
3388 std::shared_ptr<RepositoryIf>
repo;
3393 ASSERT_FALSE(repo->DataPointExists(path));
3394 EXPECT_THROW({ repo->CreateDataPoint<
ThrowInGetShape>(path); }, std::runtime_error);
3396 ASSERT_FALSE(repo->DataPointExists(second_path));
3397 EXPECT_THROW({ repo->CreateDataPoint<
ThrowInGetShape>(second_path); }, std::runtime_error);
3402 ASSERT_FALSE(repo->DataPointExists(path));
3403 EXPECT_THROW({ repo->CreateDataPoint<
ThrowInMakeSpan>(path); }, std::runtime_error);
3405 ASSERT_FALSE(repo->DataPointExists(second_path));
3406 EXPECT_THROW({ repo->CreateDataPoint<
ThrowInMakeSpan>(second_path); }, std::runtime_error);
3411 ASSERT_FALSE(repo->DataPointExists(path));
3417 std::runtime_error);
3419 ASSERT_FALSE(repo->DataPointExists(second_path));
3425 std::runtime_error);
This class provides a wrapper for a data point path.
Definition dataPointPath.hpp:77
A buffer class representing 2D matrix data.
Definition matrixBuffer.hpp:28
A span referencing a 2D matrix buffer.
Definition matrixSpan.hpp:36
Definition repositoryIf.hpp:95
An object representing one or more asynchronous I/O requests to a repository.
Definition repositoryIf.hpp:634
void DataPointExists(const DataPointPath &path, bool &result, const CallbackType &callback=nullptr) const
Definition repositoryIf.cpp:349
void WriteDataPoint(const DataPointPath &path, const T &buffer, std::optional< std::reference_wrapper< MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr)
Definition repositoryIf.ipp:1538
void DeleteDataPoint(const DataPointPath &path, const CallbackType &callback=nullptr)
Definition repositoryIf.cpp:343
void ReadDataPoint(const DataPointPath &path, T &buffer, std::optional< std::reference_wrapper< MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr) const
Definition repositoryIf.ipp:1444
void GetChildren(const DataPointPath &path, std::pair< PathList, PathList > &result, bool recurse=false, const CallbackType &callback=nullptr) const
void PartialReadDataPoint(const DataPointPath &path, T &buffer, size_t first, size_t last, size_t d_first, std::optional< std::reference_wrapper< MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr) const
Definition repositoryIf.ipp:1595
void ReadMetaData(const DataPointPath &path, MetaData &metadata, const CallbackType &callback=nullptr) const
Definition repositoryIf.cpp:367
void CreateSymlink(const DataPointPath &dp, const DataPointPath &link, const CallbackType &callback=nullptr)
Definition repositoryIf.cpp:383
void PartialWriteDataPoint(const DataPointPath &path, const T &buffer, size_t first, size_t last, size_t d_first, std::optional< std::reference_wrapper< MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr)
Definition repositoryIf.ipp:1681
void CreateDataPoint(const DataPointPath &path, const T &initial_value, std::optional< std::reference_wrapper< const MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr)
Definition repositoryIf.ipp:1385
void UpdateSymlink(const DataPointPath &dp, const DataPointPath &link, const CallbackType &callback=nullptr)
Definition repositoryIf.cpp:392
void WriteMetaData(const DataPointPath &path, const MetaData &metadata, const CallbackType &callback=nullptr)
Definition repositoryIf.cpp:375
Definition repositoryIf.hpp:90
Definition repositoryIf.hpp:86
Definition repositoryIf.hpp:82
Definition repositoryIf.hpp:78
Definition repositoryIf.hpp:74
Definition repositoryIf.hpp:103
const std::vector< Info > & GetInfo() const
Definition repositoryIf.cpp:140
@ Success
Definition repositoryIf.hpp:105
@ Failed
Definition repositoryIf.hpp:105
Definition repositoryIf.hpp:99
Abstract interface providing basic read and write facilities to a repository.
Definition repositoryIf.hpp:51
std::optional< T > TryGetDataPoint(const DataPointPath &path) const
Fetches a datapoint from the repository.
Definition repositoryIf.ipp:1861
Clock::time_point Timestamp
Definition repositoryIf.hpp:58
T GetDataPoint(const DataPointPath &path) const
Fetches a datapoint from the repository.
Definition repositoryIf.ipp:1843
void CreateDataPoint(const DataPointPath &path)
Creates a new empty datapoint in the repository.
Definition repositoryIf.ipp:1826
void SetDataPoint(const DataPointPath &path, const T &value)
Sets a datapoint in the repository.
Definition repositoryIf.ipp:1869
std::vector< DataPointPath > PathList
Definition repositoryIf.hpp:56
Definition repositoryIfTestSuite.hpp:750
T MakeWriteValueForPartialIo()
Definition repositoryIfTestSuite.hpp:872
T MakeReadValueForPartialIo(const T &result_value)
Definition repositoryIfTestSuite.hpp:986
T MakeExpectedResultValueForPartialRead()
Definition repositoryIfTestSuite.hpp:942
T MakeExpectedResultValueForPartialReadEnd()
Definition repositoryIfTestSuite.hpp:964
T MakeLargeTestValue()
Definition repositoryIfTestSuite.hpp:752
T MakeSmallTestValue()
Definition repositoryIfTestSuite.hpp:788
T MakeCreateValueForPartialIo()
Definition repositoryIfTestSuite.hpp:824
RtcVectorUInt64 ExpectedSmallTestValueShape()
Definition repositoryIfTestSuite.hpp:806
T MakeExpectedResultValueForPartialWrite()
Definition repositoryIfTestSuite.hpp:894
RtcVectorUInt64 ExpectedLargeTestValueShape()
Definition repositoryIfTestSuite.hpp:770
Definition repositoryIfTestSuite.hpp:1605
void TearDown() override
Definition repositoryIfTestSuite.hpp:1615
DataPointPath link1
Definition repositoryIfTestSuite.hpp:1642
DataPointPath path1
Definition repositoryIfTestSuite.hpp:1640
DataPointPath link2
Definition repositoryIfTestSuite.hpp:1643
void SetupDataPoints(const T &initial_value=0)
Definition repositoryIfTestSuite.hpp:1631
DataPointPath path2
Definition repositoryIfTestSuite.hpp:1641
std::shared_ptr< RepositoryIf > repo
Definition repositoryIfTestSuite.hpp:1639
void SetUp() override
Definition repositoryIfTestSuite.hpp:1607
Definition repositoryIfTestSuite.hpp:3368
void SetUp() override
Definition repositoryIfTestSuite.hpp:3370
std::vector< DataPointPath > dp_paths
Definition repositoryIfTestSuite.hpp:3387
std::shared_ptr< RepositoryIf > repo
Definition repositoryIfTestSuite.hpp:3388
void TearDown() override
Definition repositoryIfTestSuite.hpp:3378
Definition repositoryIfTestSuite.hpp:2764
std::shared_ptr< RepositoryIf > repo
Definition repositoryIfTestSuite.hpp:2786
void TearDown() override
Definition repositoryIfTestSuite.hpp:2773
DataPointPath link_path
Definition repositoryIfTestSuite.hpp:2788
void SetUp() override
Definition repositoryIfTestSuite.hpp:2766
DataPointPath link_path2
Definition repositoryIfTestSuite.hpp:2789
DataPointPath path
Definition repositoryIfTestSuite.hpp:2787
Definition repositoryIfTestSuite.hpp:2212
void TearDown() override
Definition repositoryIfTestSuite.hpp:2223
std::shared_ptr< RepositoryIf > repo
Definition repositoryIfTestSuite.hpp:2245
void SetUp() override
Definition repositoryIfTestSuite.hpp:2214
Definition repositoryIfTestSuite.hpp:3118
void TearDown() override
Definition repositoryIfTestSuite.hpp:3128
std::shared_ptr< RepositoryIf > repo
Definition repositoryIfTestSuite.hpp:3137
std::vector< DataPointPath > dp_paths
Definition repositoryIfTestSuite.hpp:3138
void SetUp() override
Definition repositoryIfTestSuite.hpp:3120
Definition repositoryIfTestSuite.hpp:1646
MOCK_METHOD(void, ReadMetaDataCallback,(const DataPointPath &path))
MOCK_METHOD(void, PartialReadCallback,(const DataPointPath &path))
MOCK_METHOD(void, DeleteCallback,(const DataPointPath &path))
MOCK_METHOD(void, ExistsCallback,(const DataPointPath &path))
MOCK_METHOD(void, CreateSymlinkCallback,(const DataPointPath &path))
MOCK_METHOD(void, CreateCallback,(const DataPointPath &path))
MOCK_METHOD(void, GetChildrenCallback,(const DataPointPath &path))
MOCK_METHOD(void, ReadCallback,(const DataPointPath &path))
MOCK_METHOD(void, WriteCallback,(const DataPointPath &path))
MOCK_METHOD(void, UpdateSymlinkCallback,(const DataPointPath &path))
MOCK_METHOD(void, PartialWriteCallback,(const DataPointPath &path))
MOCK_METHOD(void, WriteMetaDataCallback,(const DataPointPath &path))
Definition repositoryIfTestSuite.hpp:183
std::vector< DataPointPath > dp_paths
Definition repositoryIfTestSuite.hpp:270
T MakeSomeTestValue()
Definition repositoryIfTestSuite.hpp:203
void SetUp() override
Definition repositoryIfTestSuite.hpp:185
std::shared_ptr< RepositoryIf > repo
Definition repositoryIfTestSuite.hpp:271
size_t GetExpectedSize(const U &value)
Definition repositoryIfTestSuite.hpp:258
void TearDown() override
Definition repositoryIfTestSuite.hpp:194
T MakeOtherTestValue()
Definition repositoryIfTestSuite.hpp:229
Definition repositoryIfTestSuite.hpp:2536
DataPointPath target_path
Definition repositoryIfTestSuite.hpp:2561
void SetUp() override
Definition repositoryIfTestSuite.hpp:2538
void TearDown() override
Definition repositoryIfTestSuite.hpp:2544
DataPointPath target_path_2
Definition repositoryIfTestSuite.hpp:2562
std::shared_ptr< RepositoryIf > repo
Definition repositoryIfTestSuite.hpp:2560
virtual RtcVectorUInt64 GetShape() const
Definition repositoryIfTestSuite.hpp:43
TestingUserTypeBase(std::string value)
Definition repositoryIfTestSuite.hpp:41
virtual gsl::span< char > MakeSpan()
Definition repositoryIfTestSuite.hpp:47
std::string m_value
Definition repositoryIfTestSuite.hpp:63
virtual bool ResizeBuffer(const RtcVectorUInt64 &shape)
Definition repositoryIfTestSuite.hpp:54
TestingUserTypeBase()=default
virtual gsl::span< const char > MakeSpan() const
Definition repositoryIfTestSuite.hpp:50
Definition repositoryIfTestSuite.hpp:66
RtcVectorUInt64 GetShape() const override
Definition repositoryIfTestSuite.hpp:69
TestingUserTypeBase()=default
Definition repositoryIfTestSuite.hpp:74
gsl::span< char > MakeSpan() override
Definition repositoryIfTestSuite.hpp:77
gsl::span< const char > MakeSpan() const override
Definition repositoryIfTestSuite.hpp:80
TestingUserTypeBase()=default
Definition repositoryIfTestSuite.hpp:85
bool ResizeBuffer(const RtcVectorUInt64 &shape) override
Definition repositoryIfTestSuite.hpp:88
TestingUserTypeBase()=default
Definition measurable.hpp:26
RtcUInt64 GetNumOfElements(const RtcVectorUInt64 &shape)
Definition repositoryIf.ipp:136
Definition fakeClock.cpp:15
TYPED_TEST_SUITE(BasicOperation, TypeSetForBasicOperation)
::testing::Types< RtcBool, RtcInt8, RtcInt16, RtcInt32, RtcInt64, RtcUInt8, RtcUInt16, RtcUInt32, RtcUInt64, RtcFloat, RtcDouble, RtcString, RtcBinary, RtcVectorBool, RtcVectorInt8, RtcVectorInt16, RtcVectorInt32, RtcVectorInt64, RtcVectorUInt8, RtcVectorUInt16, RtcVectorUInt32, RtcVectorUInt64, RtcVectorFloat, RtcVectorDouble, RtcVectorString, RtcMatrixBool, RtcMatrixInt8, RtcMatrixInt16, RtcMatrixInt32, RtcMatrixInt64, RtcMatrixUInt8, RtcMatrixUInt16, RtcMatrixUInt32, RtcMatrixUInt64, RtcMatrixFloat, RtcMatrixDouble, RtcMatrixString > TypeSetForBasicOperation
Definition repositoryIfTestSuite.hpp:280
::testing::Types< RtcString, RtcBinary, RtcVectorBool, RtcVectorInt8, RtcVectorInt16, RtcVectorInt32, RtcVectorInt64, RtcVectorUInt8, RtcVectorUInt16, RtcVectorUInt32, RtcVectorUInt64, RtcVectorFloat, RtcVectorDouble, RtcVectorString, RtcMatrixBool, RtcMatrixInt8, RtcMatrixInt16, RtcMatrixInt32, RtcMatrixInt64, RtcMatrixUInt8, RtcMatrixUInt16, RtcMatrixUInt32, RtcMatrixUInt64, RtcMatrixFloat, RtcMatrixDouble, RtcMatrixString > TypeSetAdvancedOperation
Definition repositoryIfTestSuite.hpp:997
TEST_F(Callbacks, CreateDataPointCallback)
Definition repositoryIfTestSuite.hpp:1662
RepositoryIfTestSuite< T > BasicOperation
Definition repositoryIfTestSuite.hpp:277
TYPED_TEST(BasicOperation, DataPointExistanceConsistency)
Definition repositoryIfTestSuite.hpp:321
RepositoryIf::PathList PathList
Definition persistentRepoAdapter.cpp:96
constexpr bool IS_VECTOR_TYPE
Is true if the type is a std::vector<U> of some type U.
Definition typeTraits.hpp:47
constexpr bool IS_MATRIX_BUFFER_TYPE
Is true if the type is a MatrixBuffer<U> of some type U.
Definition typeTraits.hpp:77
Definition commandReplier.cpp:22
std::int64_t RtcInt64
Definition basicTypes.hpp:41
RtcMatrix< RtcInt8 > RtcMatrixInt8
Definition basicTypes.hpp:63
std::int16_t RtcInt16
Definition basicTypes.hpp:39
std::uint16_t RtcUInt16
Definition basicTypes.hpp:43
float RtcFloat
Definition basicTypes.hpp:46
RtcMatrix< RtcInt32 > RtcMatrixInt32
Definition basicTypes.hpp:65
std::int32_t RtcInt32
Definition basicTypes.hpp:40
std::int8_t RtcInt8
Definition basicTypes.hpp:38
RtcMatrix< RtcInt64 > RtcMatrixInt64
Definition basicTypes.hpp:66
RtcMatrix< RtcUInt64 > RtcMatrixUInt64
Definition basicTypes.hpp:70
RtcVector< RtcUInt32 > RtcVectorUInt32
Definition basicTypes.hpp:57
RtcMatrix< RtcUInt8 > RtcMatrixUInt8
Definition basicTypes.hpp:67
RtcMatrix< RtcString > RtcMatrixString
Definition basicTypes.hpp:73
RtcMatrix< RtcFloat > RtcMatrixFloat
Definition basicTypes.hpp:71
RtcVector< RtcDouble > RtcVectorDouble
Definition basicTypes.hpp:60
std::string RtcString
Definition basicTypes.hpp:48
RtcMatrix< RtcInt16 > RtcMatrixInt16
Definition basicTypes.hpp:64
RtcMatrix< RtcDouble > RtcMatrixDouble
Definition basicTypes.hpp:72
bool RtcBool
Definition basicTypes.hpp:37
RtcVector< RtcUInt16 > RtcVectorUInt16
Definition basicTypes.hpp:56
std::uint32_t RtcUInt32
Definition basicTypes.hpp:44
RtcVector< RtcInt16 > RtcVectorInt16
Definition basicTypes.hpp:52
RtcMatrix< RtcBool > RtcMatrixBool
Definition basicTypes.hpp:62
RtcVector< RtcFloat > RtcVectorFloat
Definition basicTypes.hpp:59
RtcVector< RtcInt8 > RtcVectorInt8
Definition basicTypes.hpp:51
std::uint8_t RtcUInt8
Definition basicTypes.hpp:42
RtcVector< RtcBool > RtcVectorBool
Definition basicTypes.hpp:50
RtcVector< RtcUInt64 > RtcVectorUInt64
Definition basicTypes.hpp:58
std::uint64_t RtcUInt64
Definition basicTypes.hpp:45
RtcVector< RtcString > RtcVectorString
Definition basicTypes.hpp:61
RtcVector< RtcInt32 > RtcVectorInt32
Definition basicTypes.hpp:53
std::vector< std::byte > RtcBinary
Definition basicTypes.hpp:49
RtcVector< RtcUInt8 > RtcVectorUInt8
Definition basicTypes.hpp:55
RtcMatrix< RtcUInt16 > RtcMatrixUInt16
Definition basicTypes.hpp:68
RtcVector< RtcInt64 > RtcVectorInt64
Definition basicTypes.hpp:54
RtcMatrix< RtcUInt32 > RtcMatrixUInt32
Definition basicTypes.hpp:69
double RtcDouble
Definition basicTypes.hpp:47
Definition ddsSub.hpp:156
Header file for RepositoryIf and related base classes.
static RtcVectorUInt64 GetShape(const BufferType &buffer)
Definition repositoryIfTestSuite.hpp:130
static bool ResizeBuffer(BufferType &buffer, const RtcVectorUInt64 &shape)
Definition repositoryIfTestSuite.hpp:142
test::ThrowInResizeBuffer BufferType
Definition repositoryIfTestSuite.hpp:124
std::remove_cv_t< typename std::string::value_type > ElementType
Definition repositoryIfTestSuite.hpp:125
RtcString DataPointType
Definition repositoryIfTestSuite.hpp:126
static gsl::span< ElementType > MakeSpan(BufferType &buffer)
Definition repositoryIfTestSuite.hpp:134
static gsl::span< const ElementType > MakeSpan(const BufferType &buffer)
Definition repositoryIfTestSuite.hpp:138
static const bool USES_TEMP_BUFFER
Definition repositoryIfTestSuite.hpp:127
void TempBufferType
Definition repositoryIfTestSuite.hpp:128
static const bool USES_TEMP_BUFFER
Definition repositoryIfTestSuite.hpp:152
static gsl::span< ElementType > MakeSpan(BufferType &buffer)
Definition repositoryIfTestSuite.hpp:159
static RtcVectorUInt64 GetShape(const BufferType &buffer)
Definition repositoryIfTestSuite.hpp:155
RtcString DataPointType
Definition repositoryIfTestSuite.hpp:151
void TempBufferType
Definition repositoryIfTestSuite.hpp:153
static bool ResizeBuffer(BufferType &buffer, const RtcVectorUInt64 &shape)
Definition repositoryIfTestSuite.hpp:167
test::ThrowInGetShape BufferType
Definition repositoryIfTestSuite.hpp:149
static gsl::span< const ElementType > MakeSpan(const BufferType &buffer)
Definition repositoryIfTestSuite.hpp:163
std::remove_cv_t< typename std::string::value_type > ElementType
Definition repositoryIfTestSuite.hpp:150
static const bool USES_TEMP_BUFFER
Definition repositoryIfTestSuite.hpp:102
static gsl::span< ElementType > MakeSpan(BufferType &buffer)
Definition repositoryIfTestSuite.hpp:109
void TempBufferType
Definition repositoryIfTestSuite.hpp:103
RtcString DataPointType
Definition repositoryIfTestSuite.hpp:101
static gsl::span< const ElementType > MakeSpan(const BufferType &buffer)
Definition repositoryIfTestSuite.hpp:113
static bool ResizeBuffer(BufferType &buffer, const RtcVectorUInt64 &shape)
Definition repositoryIfTestSuite.hpp:117
test::ThrowInMakeSpan BufferType
Definition repositoryIfTestSuite.hpp:99
char ElementType
Definition repositoryIfTestSuite.hpp:100
static RtcVectorUInt64 GetShape(const BufferType &buffer)
Definition repositoryIfTestSuite.hpp:105
Definition repositoryIf.ipp:152
MatrixSpan< T > SpanType
Definition repositoryIfTestSuite.hpp:1280
MatrixBuffer< T, A > BufferType
Definition repositoryIfTestSuite.hpp:1279
MatrixSpan< const T > ConstSpanType
Definition repositoryIfTestSuite.hpp:1281
boost::container::vector< bool, A > BufferType
Definition repositoryIfTestSuite.hpp:1300
MatrixSpan< const bool > ConstSpanType
Definition repositoryIfTestSuite.hpp:1302
MatrixSpan< bool > SpanType
Definition repositoryIfTestSuite.hpp:1301
gsl::span< char > SpanType
Definition repositoryIfTestSuite.hpp:1273
RtcString BufferType
Definition repositoryIfTestSuite.hpp:1272
gsl::span< const char > ConstSpanType
Definition repositoryIfTestSuite.hpp:1274
gsl::span< const T > ConstSpanType
Definition repositoryIfTestSuite.hpp:1288
std::vector< T, A > BufferType
Definition repositoryIfTestSuite.hpp:1286
gsl::span< T > SpanType
Definition repositoryIfTestSuite.hpp:1287
gsl::span< const bool > ConstSpanType
Definition repositoryIfTestSuite.hpp:1295
boost::container::vector< bool, A > BufferType
Definition repositoryIfTestSuite.hpp:1293
gsl::span< bool > SpanType
Definition repositoryIfTestSuite.hpp:1294
Definition repositoryIfTestSuite.hpp:1268
Provides useful mechanisms to test various type traits.