12#ifndef RTCTK_COMPONENTFRAMEWORK_TEST_REPOSITORYIFTESTSUITE_HPP
13#define RTCTK_COMPONENTFRAMEWORK_TEST_REPOSITORYIFTESTSUITE_HPP
18#include <gmock/gmock.h>
19#include <gtest/gtest.h>
21#include <fmt/format.h>
49 virtual gsl::span<const char>
MakeSpan()
const {
54 if (shape.size() == 1) {
69 throw std::runtime_error(
"GetShape");
77 throw std::runtime_error(
"MakeSpan");
79 gsl::span<const char>
MakeSpan()
const override {
80 throw std::runtime_error(
"MakeSpan");
88 throw std::runtime_error(
"ResizeBuffer");
124 using ElementType = std::remove_cv_t<typename std::string::value_type>;
149 using ElementType = std::remove_cv_t<typename std::string::value_type>;
175using testing::ContainerEq;
176using testing::IsEmpty;
177using testing::UnorderedElementsAreArray;
179static std::shared_ptr<RepositoryIf> MakeRepository();
185 repo = MakeRepository();
187 for (
unsigned i = 0; i < 10; i++) {
188 std::string name = fmt::format(
"/test/datapoint_{:0>2}", i);
195 if (
repo->DataPointExists(path)) {
196 repo->DeleteDataPoint(path);
203 if constexpr (std::is_same_v<T, std::byte>) {
204 return std::byte{43};
205 }
else if constexpr (std::is_same_v<T, RtcBinary>) {
206 return {std::byte{42}, std::byte{43}};
207 }
else if constexpr (std::is_same_v<T, RtcBool>) {
209 }
else if constexpr (std::is_same_v<T, RtcString>) {
211 }
else if constexpr (std::is_same_v<T, RtcMatrixBool>) {
212 return {1, 3, {
false,
true,
false}};
213 }
else if constexpr (std::is_same_v<T, RtcVectorBool>) {
214 return {
false,
false,
false};
215 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
216 return {1, 2, {
"foo",
"bar"}};
217 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
218 return {
"goo",
"gar"};
219 }
else if constexpr (std::is_arithmetic_v<T>) {
222 return {1, 2, {42, 44}};
231 if constexpr (std::is_same_v<T, std::byte>) {
232 return std::byte{43};
233 }
else if constexpr (std::is_same_v<T, RtcBinary>) {
234 return {std::byte{43}, std::byte{44}, std::byte{45}};
235 }
else if constexpr (std::is_same_v<T, RtcBool>) {
237 }
else if constexpr (std::is_same_v<T, RtcString>) {
239 }
else if constexpr (std::is_same_v<T, RtcMatrixBool>) {
240 return {2, 2, {
true,
false,
true,
false}};
241 }
else if constexpr (std::is_same_v<T, RtcVectorBool>) {
242 return {
true,
true,
true,
true};
243 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
244 return {1, 3, {
"foo",
"bar",
"baz"}};
245 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
246 return {
"goo",
"gar",
"gaz"};
247 }
else if constexpr (std::is_arithmetic_v<T>) {
250 return {1, 3, {43, 44, 45}};
256 template <
typename U>
258 if constexpr (std::is_same_v<U, std::byte>) {
259 return sizeof(value);
260 }
else if constexpr (std::is_arithmetic_v<U>) {
261 return sizeof(value);
270 std::shared_ptr<RepositoryIf>
repo;
324 auto path1 = this->dp_paths[0];
325 auto path2 = this->dp_paths[1];
326 auto& repo = *this->repo;
332 EXPECT_NO_THROW({ exists = repo.DataPointExists(path1); });
333 EXPECT_EQ(exists,
false);
334 EXPECT_NO_THROW({ exists = repo.DataPointExists(path2); });
335 EXPECT_EQ(exists,
false);
336 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/test/subdir/dummy"_dppath); });
337 EXPECT_EQ(exists,
false);
338 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/dummy"_dppath); });
339 EXPECT_EQ(exists,
false);
342 repo.template CreateDataPoint<TypeParam>(path1);
344 EXPECT_NO_THROW({ exists = repo.DataPointExists(path1); });
345 EXPECT_EQ(exists,
true);
346 EXPECT_NO_THROW({ exists = repo.DataPointExists(path2); });
347 EXPECT_EQ(exists,
false);
348 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/test/subdir/dummy"_dppath); });
349 EXPECT_EQ(exists,
false);
350 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/dummy"_dppath); });
351 EXPECT_EQ(exists,
false);
354 repo.template CreateDataPoint<TypeParam>(path2);
356 EXPECT_NO_THROW({ exists = repo.DataPointExists(path1); });
357 EXPECT_EQ(exists,
true);
358 EXPECT_NO_THROW({ exists = repo.DataPointExists(path2); });
359 EXPECT_EQ(exists,
true);
360 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/test/subdir/dummy"_dppath); });
361 EXPECT_EQ(exists,
false);
362 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/dummy"_dppath); });
363 EXPECT_EQ(exists,
false);
366 ASSERT_NO_THROW({ repo.DeleteDataPoint(path1); });
368 EXPECT_NO_THROW({ exists = repo.DataPointExists(path1); });
369 EXPECT_EQ(exists,
false);
370 EXPECT_NO_THROW({ exists = repo.DataPointExists(path2); });
371 EXPECT_EQ(exists,
true);
372 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/test/subdir/dummy"_dppath); });
373 EXPECT_EQ(exists,
false);
374 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/dummy"_dppath); });
375 EXPECT_EQ(exists,
false);
378 ASSERT_NO_THROW({ repo.DeleteDataPoint(path2); });
380 EXPECT_NO_THROW({ exists = repo.DataPointExists(path1); });
381 EXPECT_EQ(exists,
false);
382 EXPECT_NO_THROW({ exists = repo.DataPointExists(path2); });
383 EXPECT_EQ(exists,
false);
384 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/test/subdir/dummy"_dppath); });
385 EXPECT_EQ(exists,
false);
386 EXPECT_NO_THROW({ exists = repo.DataPointExists(
"/dummy"_dppath); });
387 EXPECT_EQ(exists,
false);
391 auto path = this->dp_paths[0];
392 auto& repo = *this->repo;
393 auto create_value = this->MakeSomeTestValue();
394 TypeParam read_value;
396 EXPECT_NO_THROW({ repo.DataPointExists(path); });
398 ASSERT_FALSE(repo.DataPointExists(path));
400 repo.CreateDataPoint(path, create_value);
401 ASSERT_TRUE(repo.DataPointExists(path));
403 repo.ReadDataPoint(path, read_value);
404 ASSERT_EQ(create_value, read_value);
406 repo.DeleteDataPoint(path);
407 ASSERT_FALSE(repo.DataPointExists(path));
410 repo.CreateDataPoint(path, create_value);
411 ASSERT_TRUE(repo.DataPointExists(path));
415 auto path = this->dp_paths[0];
416 auto& repo = *this->repo;
417 auto create_value = this->MakeSomeTestValue();
418 auto write_value = this->MakeOtherTestValue();
419 TypeParam read_value;
421 repo.CreateDataPoint(path, create_value);
423 repo.WriteDataPoint(path, write_value);
424 repo.ReadDataPoint(path, read_value);
425 ASSERT_EQ(write_value, read_value);
428 repo.WriteDataPoint(path, create_value);
429 repo.ReadDataPoint(path, read_value);
430 ASSERT_EQ(create_value, read_value);
434 auto path = this->dp_paths[0];
435 auto& repo = *this->repo;
436 const auto create_value = this->MakeSomeTestValue();
437 const auto write_value = this->MakeOtherTestValue();
438 TypeParam read_value;
440 repo.CreateDataPoint(path, create_value);
442 repo.WriteDataPoint(path, write_value);
443 repo.ReadDataPoint(path, read_value);
444 ASSERT_EQ(write_value, read_value);
447 repo.WriteDataPoint(path, create_value);
448 repo.ReadDataPoint(path, read_value);
449 ASSERT_EQ(create_value, read_value);
453 auto path = this->dp_paths[0];
455 auto create_value = this->MakeSomeTestValue();
456 auto write_value = this->MakeOtherTestValue();
461 ASSERT_EQ(write_value, repo.
GetDataPoint<TypeParam>(path));
466 ASSERT_FALSE(repo.
TryGetDataPoint<TypeParam>(
"/non/existing/dp"_dppath).has_value());
470 auto path = this->dp_paths[0];
471 auto& repo = *this->repo;
472 auto create_value = this->MakeSomeTestValue();
474 repo.CreateDataPoint(path, create_value);
476 const auto& type = repo.GetDataPointType(path);
478 EXPECT_EQ(type,
typeid(TypeParam));
482 auto path = this->dp_paths[0];
483 auto& repo = *this->repo;
484 auto create_value = this->MakeSomeTestValue();
485 auto create_value_size = this->GetExpectedSize(create_value);
487 repo.CreateDataPoint(path, create_value);
488 ASSERT_EQ(repo.GetDataPointSize(path), create_value_size);
492 auto path = this->dp_paths[0];
493 auto& repo = *this->repo;
494 auto create_value = this->MakeSomeTestValue();
496 repo.CreateDataPoint(path, create_value);
497 auto shape = repo.GetDataPointShape(path);
499 if constexpr (std::is_same_v<TypeParam, std::byte>) {
500 ASSERT_TRUE(shape.empty());
501 }
else if constexpr (std::is_arithmetic_v<TypeParam>) {
502 ASSERT_TRUE(shape.empty());
504 ASSERT_EQ(shape.size(), 2);
505 ASSERT_EQ(shape[0], create_value.GetNrows());
506 ASSERT_EQ(shape[1], create_value.GetNcols());
508 ASSERT_EQ(shape.size(), 1);
509 ASSERT_EQ(shape[0], create_value.size());
510 }
else if constexpr (std::is_same_v<TypeParam, RtcString>) {
511 ASSERT_EQ(shape.size(), 1);
512 ASSERT_EQ(shape[0], create_value.size());
514 FAIL() <<
"Should never enter here. There is a bug in the test code.";
519 auto path = this->dp_paths[0];
520 auto& repo = *this->repo;
523 auto create_value = this->MakeSomeTestValue();
524 auto write_value = this->MakeOtherTestValue();
525 TypeParam read_value;
533 repo.SendRequest(req).Wait();
535 ASSERT_EQ(exists,
true);
536 ASSERT_EQ(write_value, read_value);
545 repo.SendRequest(req).Wait();
547 ASSERT_EQ(exists,
false);
552 auto path = this->dp_paths[0];
553 auto& repo = *this->repo;
556 const auto create_value = this->MakeSomeTestValue();
557 const auto write_value = this->MakeOtherTestValue();
558 TypeParam read_value;
566 repo.SendRequest(req).Wait();
568 ASSERT_EQ(exists,
true);
569 ASSERT_EQ(write_value, read_value);
578 repo.SendRequest(req).Wait();
580 ASSERT_EQ(exists,
false);
585 auto& repo = *this->repo;
586 auto path_1 = this->dp_paths[0];
587 auto path_2 = this->dp_paths[1];
588 auto create_value_1 = this->MakeSomeTestValue();
589 auto create_value_2 = this->MakeOtherTestValue();
590 auto write_value_1 = create_value_2;
591 auto write_value_2 = create_value_1;
592 TypeParam read_value_1;
593 TypeParam read_value_2;
599 repo.SendRequest(req).Wait();
602 repo.WriteDataPoints(path_1, write_value_1, path_2, write_value_2);
608 repo.SendRequest(req).Wait();
611 ASSERT_EQ(read_value_1, write_value_1);
612 ASSERT_EQ(read_value_2, write_value_2);
616 auto& repo = *this->repo;
617 auto path_1 = this->dp_paths[0];
618 auto path_2 = this->dp_paths[1];
619 auto create_value_1 = this->MakeSomeTestValue();
620 auto create_value_2 = this->MakeOtherTestValue();
621 TypeParam read_value_1;
622 TypeParam read_value_2;
628 repo.SendRequest(req).Wait();
631 repo.ReadDataPoints(path_1, read_value_1, path_2, read_value_2);
633 ASSERT_EQ(read_value_1, create_value_1);
634 ASSERT_EQ(read_value_2, create_value_2);
638 auto path = this->dp_paths[0];
640 auto create_value = this->MakeSomeTestValue();
641 auto write_value = this->MakeOtherTestValue();
642 std::any any_write_value = write_value;
648 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();
659 TypeParam& read_value = std::any_cast<TypeParam&>(any_read_value);
660 EXPECT_EQ(write_value, read_value);
665 auto path = this->dp_paths[0];
666 auto& repo = *this->repo;
669 auto create_value = this->MakeSomeTestValue();
670 std::any any_create_value = create_value;
671 repo.CreateDataPoint(path, any_create_value);
673 std::any any_read_value;
674 repo.ReadDataPoint(path, any_read_value);
676 TypeParam& read_value = std::any_cast<TypeParam&>(any_read_value);
677 EXPECT_EQ(create_value, read_value);
681 auto write_value = this->MakeOtherTestValue();
682 std::any any_write_value = write_value;
683 repo.WriteDataPoint(path, any_write_value);
685 std::any any_read_value;
686 repo.ReadDataPoint(path, any_read_value);
688 TypeParam& read_value = std::any_cast<TypeParam&>(any_read_value);
689 EXPECT_EQ(write_value, read_value);
694 auto& repo = *this->repo;
695 auto path_1 = this->dp_paths[0];
696 auto path_2 = this->dp_paths[1];
697 auto create_value_1 = this->MakeSomeTestValue();
698 auto create_value_2 = this->MakeOtherTestValue();
699 auto write_value_1 = create_value_2;
700 auto write_value_2 = create_value_1;
701 TypeParam read_value_1;
702 TypeParam read_value_2;
708 repo.SendRequest(req).Wait();
711 std::any any_write_value_1 = write_value_1;
712 std::any any_write_value_2 = write_value_2;
713 repo.WriteDataPoints(path_1, any_write_value_1, path_2, any_write_value_2);
719 repo.SendRequest(req).Wait();
722 EXPECT_EQ(read_value_1, write_value_1);
723 EXPECT_EQ(read_value_2, write_value_2);
727 auto& repo = *this->repo;
728 auto path_1 = this->dp_paths[0];
729 auto path_2 = this->dp_paths[1];
730 auto create_value_1 = this->MakeSomeTestValue();
731 auto create_value_2 = this->MakeOtherTestValue();
737 repo.SendRequest(req).Wait();
740 std::any any_read_value_1;
741 std::any any_read_value_2;
742 repo.ReadDataPoints(path_1, any_read_value_1, path_2, any_read_value_2);
745 TypeParam& read_value_1 = std::any_cast<TypeParam&>(any_read_value_1);
747 TypeParam& read_value_2 = std::any_cast<TypeParam&>(any_read_value_2);
748 EXPECT_EQ(read_value_1, create_value_1);
749 EXPECT_EQ(read_value_2, create_value_2);
758 if constexpr (std::is_same_v<T, RtcBinary>) {
759 return T(5000, std::byte{43});
760 }
else if constexpr (std::is_same_v<T, RtcString>) {
761 return std::string(5000,
'c');
762 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
763 return T(500, 500, std::vector<std::string>(500 * 500, std::string(
"foo")));
764 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
765 return T(5000, std::string(
"foo"));
767 return {500, 500, std::vector<typename T::value_type>(500 * 500, 42)};
776 if constexpr (std::is_same_v<T, RtcBinary>) {
778 }
else if constexpr (std::is_same_v<T, RtcString>) {
780 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
782 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
794 if constexpr (std::is_same_v<T, RtcBinary>) {
795 return T(2, std::byte{42});
796 }
else if constexpr (std::is_same_v<T, RtcString>) {
797 return std::string(2,
'b');
798 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
799 return T(2, 2, std::vector<std::string>(2 * 2, std::string(
"goo")));
800 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
801 return T(2, std::string(
"goo"));
803 return {2, 2, std::vector<typename T::value_type>(2 * 2, 43)};
812 if constexpr (std::is_same_v<T, RtcBinary>) {
814 }
else if constexpr (std::is_same_v<T, RtcString>) {
816 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
818 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
830 if constexpr (std::is_same_v<T, RtcString>) {
831 return "0123456789abcdef";
832 }
else if constexpr (std::is_same_v<T, RtcBinary>) {
834 return { std::byte{1}, std::byte{2}, std::byte{3}, std::byte{4},
835 std::byte{5}, std::byte{6}, std::byte{7}, std::byte{8},
836 std::byte{9}, std::byte{10}, std::byte{11}, std::byte{12},
837 std::byte{13}, std::byte{14}, std::byte{15}, std::byte{16}};
839 }
else if constexpr (std::is_same_v<T, RtcMatrixBool>) {
841 return {4, 4, {
true,
true,
false,
false,
842 false,
false,
true,
false,
843 false,
false,
false,
true,
844 false,
false,
false,
false}};
846 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
848 return {4, 4, {
"1",
"2",
"3",
"4",
850 "9",
"10",
"11",
"12",
851 "13",
"14",
"15",
"16"}};
853 }
else if constexpr (std::is_same_v<T, RtcVectorBool>) {
855 return {
true,
false,
true,
false,
true,
false,
true,
false,
856 true,
false,
true,
false,
true,
false,
true,
false};
858 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
860 return {
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
861 "9",
"10",
"11",
"12",
"13",
"14",
"15",
"16"};
865 return {4, 4, { 1, 2, 3, 4,
871 return {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
873 static_assert(
false,
"Should never enter here. There is a bug in the test code.");
878 if constexpr (std::is_same_v<T, RtcString>) {
880 }
else if constexpr (std::is_same_v<T, RtcBinary>) {
881 return {std::byte{12}, std::byte{13}, std::byte{14}, std::byte{15}};
882 }
else if constexpr (std::is_same_v<T, RtcMatrixBool>) {
883 return {1, 4, {
false,
false,
true,
true}};
884 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
885 return {1, 4, {
"12",
"13",
"14",
"15"}};
886 }
else if constexpr (std::is_same_v<T, RtcVectorBool>) {
887 return {
true,
true,
true,
true};
888 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
889 return {
"12",
"13",
"14",
"15"};
891 return {1, 4, {12, 13, 14, 15}};
893 return {12, 13, 14, 15};
895 static_assert(
false,
"Should never enter here. There is a bug in the test code.");
900 if constexpr (std::is_same_v<T, RtcString>) {
901 return "abcd456789abcdef";
902 }
else if constexpr (std::is_same_v<T, RtcBinary>) {
904 return {std::byte{12}, std::byte{13}, std::byte{14}, std::byte{15},
905 std::byte{5}, std::byte{6}, std::byte{7}, std::byte{8},
906 std::byte{9}, std::byte{10}, std::byte{11}, std::byte{12},
907 std::byte{13}, std::byte{14}, std::byte{15}, std::byte{16}};
909 }
else if constexpr (std::is_same_v<T, RtcMatrixBool>) {
911 return {4, 4, {
false,
false,
true,
true,
912 false,
false,
true,
false,
913 false,
false,
false,
true,
914 false,
false,
false,
false}};
916 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
918 return {4, 4, {
"12",
"13",
"14",
"15",
920 "9",
"10",
"11",
"12",
921 "13",
"14",
"15",
"16"}};
923 }
else if constexpr (std::is_same_v<T, RtcVectorBool>) {
925 return {
true,
true,
true,
true,
true,
false,
true,
false,
926 true,
false,
true,
false,
true,
false,
true,
false};
928 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
930 return {
"12",
"13",
"14",
"15",
"5",
"6",
"7",
"8",
931 "9",
"10",
"11",
"12",
"13",
"14",
"15",
"16"};
935 return {4, 4, {12, 13, 14, 15,
941 return {12, 13, 14, 15, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
943 static_assert(
false,
"Should never enter here. There is a bug in the test code.");
948 if constexpr (std::is_same_v<T, RtcString>) {
950 }
else if constexpr (std::is_same_v<T, RtcBinary>) {
951 return {std::byte{1}, std::byte{2}, std::byte{3}, std::byte{4}};
952 }
else if constexpr (std::is_same_v<T, RtcMatrixBool>) {
953 return {1, 4, {
true,
true,
false,
false}};
954 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
955 return {1, 4, {
"1",
"2",
"3",
"4"}};
956 }
else if constexpr (std::is_same_v<T, RtcVectorBool>) {
957 return {
true,
false,
true,
false};
958 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
959 return {
"1",
"2",
"3",
"4"};
961 return {1, 4, {1, 2, 3, 4}};
965 static_assert(
false,
"Should never enter here. There is a bug in the test code.");
970 if constexpr (std::is_same_v<T, RtcString>) {
972 }
else if constexpr (std::is_same_v<T, RtcBinary>) {
973 return {std::byte{13}, std::byte{14}, std::byte{15}, std::byte{16}};
974 }
else if constexpr (std::is_same_v<T, RtcMatrixBool>) {
975 return {1, 4, {
false,
false,
false,
false}};
976 }
else if constexpr (std::is_same_v<T, RtcMatrixString>) {
977 return {1, 4, {
"13",
"14",
"15",
"16"}};
978 }
else if constexpr (std::is_same_v<T, RtcVectorBool>) {
979 return {
true,
false,
true,
false};
980 }
else if constexpr (std::is_same_v<T, RtcVectorString>) {
981 return {
"13",
"14",
"15",
"16"};
983 return {1, 4, {13, 14, 15, 16}};
985 return {13, 14, 15, 16};
987 static_assert(
false,
"Should never enter here. There is a bug in the test code.");
994 read_value.resize(result_value.GetNrows(), result_value.GetNcols());
996 read_value.resize(result_value.size());
1032 auto path = this->dp_paths[0];
1033 auto& repo = *this->repo;
1034 auto create_value = this->MakeSomeTestValue();
1035 auto write_value = this->MakeOtherTestValue();
1037 repo.CreateDataPoint(path, create_value);
1038 auto create_shape = repo.GetDataPointShape(path);
1039 repo.WriteDataPoint(path, write_value);
1040 auto write_shape = repo.GetDataPointShape(path);
1042 EXPECT_NE(create_shape, write_shape);
1046 auto path = this->dp_paths[0];
1047 auto& repo = *this->repo;
1049 auto create_value = this->MakeLargeTestValue();
1050 TypeParam read_value;
1055 repo.SendRequest(req).Wait();
1057 ASSERT_EQ(read_value, create_value);
1061 auto path = this->dp_paths[0];
1062 auto& repo = *this->repo;
1064 auto create_value = this->MakeSmallTestValue();
1065 auto write_value = this->MakeLargeTestValue();
1066 auto expected_shape = this->ExpectedLargeTestValueShape();
1067 TypeParam read_value;
1069 auto val = this->MakeLargeTestValue();
1070 EXPECT_EQ(val, write_value);
1076 repo.SendRequest(req).Wait();
1077 EXPECT_EQ(read_value, write_value);
1079 auto shape = repo.GetDataPointShape(path);
1080 EXPECT_EQ(shape, expected_shape);
1084 auto path = this->dp_paths[0];
1085 auto& repo = *this->repo;
1087 auto create_value = this->MakeLargeTestValue();
1088 auto write_value = this->MakeSmallTestValue();
1089 auto expected_shape = this->ExpectedSmallTestValueShape();
1090 TypeParam read_value;
1096 repo.SendRequest(req).Wait();
1097 ASSERT_EQ(read_value, write_value);
1099 auto shape = repo.GetDataPointShape(path);
1100 EXPECT_EQ(shape, expected_shape);
1104 auto path = this->dp_paths[0];
1105 auto& repo = *this->repo;
1107 TypeParam create_value;
1108 TypeParam write_value;
1109 TypeParam read_value_1;
1110 TypeParam read_value_2;
1113 if constexpr (std::is_same_v<TypeParam, RtcBinary>) {
1114 create_value.resize(1, std::byte{42});
1115 expected_shape = {0};
1116 }
else if constexpr (std::is_same_v<TypeParam, RtcMatrixString>) {
1117 create_value.resize(1, 1,
"foo");
1118 expected_shape = {0, 0};
1119 }
else if constexpr (std::is_same_v<TypeParam, RtcVectorString>) {
1120 create_value.resize(1,
"foo");
1121 expected_shape = {0};
1122 }
else if constexpr (std::is_same_v<TypeParam, RtcString>) {
1123 create_value = std::string(1,
'c');
1124 expected_shape = {0};
1126 create_value.resize(1, 1, 42);
1127 expected_shape = {0, 0};
1129 create_value.resize(1, 42);
1130 expected_shape = {0};
1132 FAIL() <<
"Should never enter here. There is a bug in the test code.";
1140 repo.SendRequest(req).Wait();
1141 ASSERT_EQ(read_value_1, create_value);
1142 ASSERT_EQ(read_value_2, write_value);
1144 auto shape = repo.GetDataPointShape(path);
1145 EXPECT_EQ(shape, expected_shape);
1149 auto path = this->dp_paths[0];
1150 auto& repo = *this->repo;
1152 TypeParam create_value;
1153 TypeParam write_value;
1154 TypeParam read_value;
1157 if constexpr (std::is_same_v<TypeParam, RtcBinary>) {
1158 create_value.resize(5000, std::byte{42});
1159 expected_shape = {0};
1160 }
else if constexpr (std::is_same_v<TypeParam, RtcMatrixString>) {
1161 create_value.resize(500, 500,
"foo");
1162 expected_shape = {0, 0};
1163 }
else if constexpr (std::is_same_v<TypeParam, RtcVectorString>) {
1164 create_value.resize(5000,
"foo");
1165 expected_shape = {0};
1166 }
else if constexpr (std::is_same_v<TypeParam, RtcString>) {
1167 create_value = std::string(5000,
'c');
1168 expected_shape = {0};
1170 create_value.resize(500, 500, 42);
1171 expected_shape = {0, 0};
1173 create_value.resize(5000, 42);
1174 expected_shape = {0};
1176 FAIL() <<
"Should never enter here. There is a bug in the test code.";
1183 repo.SendRequest(req).Wait();
1184 ASSERT_EQ(read_value, write_value);
1186 auto shape = repo.GetDataPointShape(path);
1187 EXPECT_EQ(shape, expected_shape);
1191 auto path = this->dp_paths[0];
1192 auto& repo = *this->repo;
1194 TypeParam create_value = this->MakeCreateValueForPartialIo();
1195 TypeParam write_value = this->MakeWriteValueForPartialIo();
1196 TypeParam read_value;
1197 TypeParam result_value = this->MakeExpectedResultValueForPartialWrite();
1203 repo.SendRequest(req).Wait();
1205 EXPECT_EQ(read_value, result_value);
1209 auto path = this->dp_paths[0];
1210 auto& repo = *this->repo;
1214 TypeParam create_value = this->MakeCreateValueForPartialIo();
1215 TypeParam result_value = this->MakeExpectedResultValueForPartialRead();
1216 TypeParam read_value = this->MakeReadValueForPartialIo(result_value);
1221 repo.SendRequest(req).Wait();
1222 EXPECT_EQ(read_value, result_value);
1227 TypeParam result_value = this->MakeExpectedResultValueForPartialReadEnd();
1228 TypeParam read_value = this->MakeReadValueForPartialIo(result_value);
1232 repo.SendRequest(req).Wait();
1233 EXPECT_EQ(read_value, result_value);
1238 auto path = this->dp_paths[0];
1239 auto& repo = *this->repo;
1241 TypeParam create_value = this->MakeCreateValueForPartialIo();
1242 std::any any_write_value = this->MakeWriteValueForPartialIo();
1243 TypeParam read_value;
1244 TypeParam result_value = this->MakeExpectedResultValueForPartialWrite();
1250 repo.SendRequest(req).Wait();
1252 EXPECT_EQ(read_value, result_value);
1256 auto path = this->dp_paths[0];
1257 auto& repo = *this->repo;
1259 TypeParam create_value = this->MakeCreateValueForPartialIo();
1260 TypeParam result_value = this->MakeExpectedResultValueForPartialRead();
1261 std::any any_read_value = this->MakeReadValueForPartialIo(result_value);
1266 repo.SendRequest(req).Wait();
1269 TypeParam& read_value = std::any_cast<TypeParam&>(any_read_value);
1270 EXPECT_EQ(read_value, result_value);
1273template <
typename T>
1283template <
typename T,
typename A>
1290template <
typename T,
typename A>
1297template <
typename A>
1304template <
typename A>
1312 auto path1 = this->dp_paths[0];
1313 auto path2 = this->dp_paths[1];
1314 auto& repo = *this->repo;
1317 BufferType create_value;
1318 BufferType write_value;
1319 BufferType read_value;
1321 if constexpr (std::is_same_v<TypeParam, RtcString>) {
1322 create_value =
"abcd";
1323 write_value =
"1234";
1324 read_value.resize(create_value.size());
1325 }
else if constexpr (std::is_same_v<TypeParam, RtcBinary>) {
1326 create_value = {std::byte{1}, std::byte{2}, std::byte{3}, std::byte{4}};
1327 write_value = {std::byte{11}, std::byte{12}, std::byte{13}, std::byte{14}};
1328 read_value.resize(create_value.size());
1329 }
else if constexpr (std::is_same_v<TypeParam, RtcMatrixBool>) {
1330 create_value = {
true,
true,
false,
false};
1331 write_value = {
false,
false,
true,
true};
1332 read_value.resize(create_value.size());
1333 }
else if constexpr (std::is_same_v<TypeParam, RtcMatrixString>) {
1334 create_value = {2, 2, {
"aa",
"bb",
"cc",
"dd"}};
1335 write_value = {2, 2, {
"00",
"11",
"22",
"33"}};
1336 read_value.resize(create_value.GetNrows(), create_value.GetNcols());
1338 create_value = {2, 2, {1, 2, 3, 4}};
1339 write_value = {2, 2, {11, 12, 13, 14}};
1340 read_value.resize(create_value.GetNrows(), create_value.GetNcols());
1341 }
else if constexpr (std::is_same_v<TypeParam, RtcVectorBool>) {
1342 create_value = {
true,
false,
true,
false};
1343 write_value = {
false,
true,
false,
true};
1344 read_value.resize(create_value.size());
1345 }
else if constexpr (std::is_same_v<TypeParam, RtcVectorString>) {
1346 create_value = {
"aa",
"bb",
"cc",
"dd"};
1347 write_value = {
"00",
"11",
"22",
"33"};
1348 read_value.resize(create_value.size());
1350 create_value = {1, 2, 3, 4};
1351 write_value = {11, 12, 13, 14};
1352 read_value.resize(create_value.size());
1354 FAIL() <<
"Should never enter here. There is a bug in the test code.";
1360 ConstSpanT create_const_span;
1362 ConstSpanT write_const_span;
1365 if constexpr (std::is_same_v<TypeParam, RtcMatrixBool>) {
1366 create_span = SpanT(2, 2, create_value);
1367 create_const_span = ConstSpanT(2, 2, create_value);
1368 write_span = SpanT(2, 2, write_value);
1369 write_const_span = ConstSpanT(2, 2, write_value);
1370 read_span = SpanT(2, 2, read_value);
1372 create_span = SpanT(create_value);
1373 create_const_span = ConstSpanT(create_value);
1374 write_span = SpanT(write_value);
1375 write_const_span = ConstSpanT(write_value);
1376 read_span = SpanT(read_value);
1380 repo.CreateDataPoint(path1, create_span);
1381 ASSERT_EQ(repo.GetDataPointType(path1),
typeid(TypeParam));
1383 repo.ReadDataPoint(path1, read_span);
1384 ASSERT_THAT(read_value, ContainerEq(create_value));
1386 repo.WriteDataPoint(path1, write_span);
1387 repo.ReadDataPoint(path1, read_span);
1388 ASSERT_THAT(read_value, ContainerEq(write_value));
1391 repo.CreateDataPoint(path2, create_const_span);
1392 ASSERT_EQ(repo.GetDataPointType(path2),
typeid(TypeParam));
1394 repo.ReadDataPoint(path2, read_span);
1395 ASSERT_THAT(read_value, ContainerEq(create_value));
1397 repo.WriteDataPoint(path2, write_const_span);
1398 repo.ReadDataPoint(path2, read_span);
1399 ASSERT_THAT(read_value, ContainerEq(write_value));
1401 if constexpr (std::is_same_v<TypeParam, RtcString>) {
1404 auto path3 = this->dp_paths[2];
1405 std::string_view create_view = create_value;
1406 std::string_view write_view = write_value;
1408 repo.CreateDataPoint(path3, create_view);
1409 ASSERT_EQ(repo.GetDataPointType(path3),
typeid(TypeParam));
1411 repo.ReadDataPoint(path3, read_value);
1412 ASSERT_THAT(read_value, ContainerEq(create_value));
1414 repo.WriteDataPoint(path3, write_view);
1415 repo.ReadDataPoint(path3, read_value);
1416 ASSERT_THAT(read_value, ContainerEq(write_value));
1421 auto path = this->dp_paths[0];
1422 auto& repo = *this->repo;
1425 using ArrayType = std::array<typename TypeParam::value_type, 4>;
1426 ArrayType create_array;
1427 ArrayType write_array;
1428 ArrayType read_array;
1429 if constexpr (std::is_same_v<TypeParam, RtcString>) {
1430 create_array = {
'a',
'b',
'c',
'd'};
1431 write_array = {
'1',
'2',
'3',
'4'};
1432 }
else if constexpr (std::is_same_v<TypeParam, RtcBinary>) {
1433 create_array = {std::byte{1}, std::byte{2}, std::byte{3}, std::byte{4}};
1434 write_array = {std::byte{11}, std::byte{12}, std::byte{13}, std::byte{14}};
1435 }
else if constexpr (std::is_same_v<TypeParam, RtcVectorBool>) {
1436 create_array = {
true,
false,
true,
false};
1437 write_array = {
false,
true,
false,
true};
1438 }
else if constexpr (std::is_same_v<TypeParam, RtcVectorString>) {
1439 create_array = {
"aa",
"bb",
"cc",
"dd"};
1440 write_array = {
"00",
"11",
"22",
"33"};
1442 create_array = {1, 2, 3, 4};
1443 write_array = {11, 12, 13, 14};
1446 repo.CreateDataPoint(path, create_array);
1447 ASSERT_EQ(repo.GetDataPointType(path),
typeid(TypeParam));
1449 repo.ReadDataPoint(path, read_array);
1450 ASSERT_EQ(create_array, read_array);
1452 repo.WriteDataPoint(path, write_array);
1453 repo.ReadDataPoint(path, read_array);
1454 ASSERT_EQ(write_array, read_array);
1457 using Row = std::array<typename TypeParam::value_type, 2>;
1458 using MatrixType = std::array<Row, 2>;
1459 MatrixType create_array;
1460 MatrixType write_array;
1461 MatrixType read_array;
1462 if constexpr (std::is_same_v<TypeParam, RtcMatrixBool>) {
1463 create_array = {Row{
true,
false}, Row{
true,
false}};
1464 write_array = {Row{
false,
true}, Row{
false,
true}};
1465 }
else if constexpr (std::is_same_v<TypeParam, RtcMatrixString>) {
1466 create_array = {Row{
"aa",
"bb"}, Row{
"cc",
"dd"}};
1467 write_array = {Row{
"00",
"11"}, Row{
"22",
"33"}};
1469 create_array = {Row{1, 2}, Row{3, 4}};
1470 write_array = {Row{11, 12}, Row{13, 14}};
1473 repo.CreateDataPoint(path, create_array);
1474 ASSERT_EQ(repo.GetDataPointType(path),
typeid(TypeParam));
1476 repo.ReadDataPoint(path, read_array);
1477 ASSERT_EQ(create_array, read_array);
1479 repo.WriteDataPoint(path, write_array);
1480 repo.ReadDataPoint(path, read_array);
1481 ASSERT_EQ(write_array, read_array);
1484 FAIL() <<
"Should never enter here. There is a bug in the test code.";
1489 using testing::ElementsAreArray;
1490 auto path = this->dp_paths[0];
1491 auto& repo = *this->repo;
1494 using ValueType =
typename TypeParam::value_type;
1495 ValueType create_array[4];
1496 ValueType write_array[4];
1497 ValueType read_array[4];
1498 if constexpr (std::is_same_v<TypeParam, RtcString>) {
1499 create_array[0] =
'a';
1500 create_array[1] =
'b';
1501 create_array[2] =
'c';
1502 create_array[3] =
'd';
1503 write_array[0] =
'1';
1504 write_array[1] =
'2';
1505 write_array[2] =
'3';
1506 write_array[3] =
'4';
1507 }
else if constexpr (std::is_same_v<TypeParam, RtcBinary>) {
1508 create_array[0] = std::byte{1};
1509 create_array[1] = std::byte{2};
1510 create_array[2] = std::byte{3};
1511 create_array[3] = std::byte{4};
1512 write_array[0] = std::byte{11};
1513 write_array[1] = std::byte{12};
1514 write_array[2] = std::byte{13};
1515 write_array[3] = std::byte{14};
1516 }
else if constexpr (std::is_same_v<TypeParam, RtcVectorBool>) {
1517 create_array[0] =
true;
1518 create_array[1] =
false;
1519 create_array[2] =
false;
1520 create_array[3] =
true;
1521 write_array[0] =
false;
1522 write_array[1] =
true;
1523 write_array[2] =
true;
1524 write_array[3] =
false;
1525 }
else if constexpr (std::is_same_v<TypeParam, RtcVectorString>) {
1526 create_array[0] =
"aa";
1527 create_array[1] =
"bb";
1528 create_array[2] =
"cc";
1529 create_array[3] =
"dd";
1530 write_array[0] =
"00";
1531 write_array[1] =
"11";
1532 write_array[2] =
"22";
1533 write_array[3] =
"33";
1535 create_array[0] = 1;
1536 create_array[1] = 2;
1537 create_array[2] = 3;
1538 create_array[3] = 4;
1539 write_array[0] = 11;
1540 write_array[1] = 12;
1541 write_array[2] = 13;
1542 write_array[3] = 14;
1545 repo.CreateDataPoint(path, create_array);
1546 ASSERT_EQ(repo.GetDataPointType(path),
typeid(TypeParam));
1548 repo.ReadDataPoint(path, read_array);
1549 gsl::span<ValueType, 4> create_span(std::begin(create_array), std::end(create_array));
1550 EXPECT_THAT(create_span, ElementsAreArray(std::begin(read_array), std::end(read_array)));
1552 repo.WriteDataPoint(path, write_array);
1553 repo.ReadDataPoint(path, read_array);
1554 gsl::span<ValueType, 4> write_span(std::begin(write_array), std::end(write_array));
1555 EXPECT_THAT(write_span, ElementsAreArray(std::begin(read_array), std::end(read_array)));
1558 using ValueType =
typename TypeParam::value_type;
1559 ValueType create_array[2][2];
1560 ValueType write_array[2][2];
1561 ValueType read_array[2][2];
1562 if constexpr (std::is_same_v<TypeParam, RtcMatrixBool>) {
1563 create_array[0][0] =
true;
1564 create_array[0][1] =
false;
1565 create_array[1][0] =
false;
1566 create_array[1][1] =
true;
1567 write_array[0][0] =
false;
1568 write_array[0][1] =
true;
1569 write_array[1][0] =
true;
1570 write_array[1][1] =
false;
1571 }
else if constexpr (std::is_same_v<TypeParam, RtcMatrixString>) {
1572 create_array[0][0] =
"aa";
1573 create_array[0][1] =
"bb";
1574 create_array[1][0] =
"cc";
1575 create_array[1][1] =
"dd";
1576 write_array[0][0] =
"00";
1577 write_array[0][1] =
"11";
1578 write_array[1][0] =
"22";
1579 write_array[1][1] =
"33";
1581 create_array[0][0] = 1;
1582 create_array[0][1] = 2;
1583 create_array[1][0] = 3;
1584 create_array[1][1] = 4;
1585 write_array[0][0] = 11;
1586 write_array[0][1] = 12;
1587 write_array[1][0] = 13;
1588 write_array[1][1] = 14;
1590 gsl::span<ValueType, 2 * 2> read_span(&read_array[0][0], 2 * 2);
1592 repo.CreateDataPoint(path, create_array);
1593 ASSERT_EQ(repo.GetDataPointType(path),
typeid(TypeParam));
1595 repo.ReadDataPoint(path, read_array);
1596 gsl::span<ValueType, 2 * 2> create_span(&create_array[0][0], 2 * 2);
1597 EXPECT_THAT(create_span, ElementsAreArray(read_span.begin(), read_span.end()));
1599 repo.WriteDataPoint(path, write_array);
1600 repo.ReadDataPoint(path, read_array);
1601 gsl::span<ValueType, 2 * 2> write_span(&write_array[0][0], 2 * 2);
1602 EXPECT_THAT(write_span, ElementsAreArray(read_span.begin(), read_span.end()));
1605 FAIL() <<
"Should never enter here. There is a bug in the test code.";
1614 repo = MakeRepository();
1615 path1 =
"/foo"_dppath;
1616 path2 =
"/bar"_dppath;
1617 link1 =
"/link1"_dppath;
1618 link2 =
"/link2"_dppath;
1636 template <
typename T = RtcInt64>
1641 repo->SendRequest(req).Wait();
1645 std::shared_ptr<RepositoryIf>
repo;
1671 EXPECT_CALL(callbacks, CreateCallback(path1)).Times(1);
1672 EXPECT_CALL(callbacks, CreateCallback(path2)).Times(1);
1674 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.CreateCallback(path); };
1681 repo->SendRequest(req).Wait();
1687 EXPECT_CALL(callbacks, DeleteCallback(path1)).Times(1);
1688 EXPECT_CALL(callbacks, DeleteCallback(path2)).Times(1);
1690 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.DeleteCallback(path); };
1697 repo->SendRequest(req).Wait();
1702 bool exists_1, exists_2;
1704 EXPECT_CALL(callbacks, ExistsCallback(path1)).Times(1);
1705 EXPECT_CALL(callbacks, ExistsCallback(path2)).Times(1);
1707 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.ExistsCallback(path); };
1712 repo->SendRequest(req).Wait();
1717 std::pair<RepositoryIf::PathList, RepositoryIf::PathList> children_1, children_2;
1719 EXPECT_CALL(callbacks, GetChildrenCallback(path1)).Times(1);
1720 EXPECT_CALL(callbacks, GetChildrenCallback(path2)).Times(1);
1722 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.GetChildrenCallback(path); };
1727 repo->SendRequest(req).Wait();
1735 EXPECT_CALL(callbacks, WriteCallback(path1)).Times(1);
1736 EXPECT_CALL(callbacks, WriteCallback(path2)).Times(1);
1738 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.WriteCallback(path); };
1745 repo->SendRequest(req).Wait();
1752 EXPECT_CALL(callbacks, ReadCallback(path1)).Times(1);
1753 EXPECT_CALL(callbacks, ReadCallback(path2)).Times(1);
1755 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.ReadCallback(path); };
1762 repo->SendRequest(req).Wait();
1770 EXPECT_CALL(callbacks, PartialWriteCallback(path1)).Times(1);
1771 EXPECT_CALL(callbacks, PartialWriteCallback(path2)).Times(1);
1773 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.PartialWriteCallback(path); };
1779 req.PartialWriteDataPoint(path2, buffer2, 0, 2, 0, std::nullopt, cb);
1780 repo->SendRequest(req).Wait();
1788 EXPECT_CALL(callbacks, PartialReadCallback(path1)).Times(1);
1789 EXPECT_CALL(callbacks, PartialReadCallback(path2)).Times(1);
1791 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.PartialReadCallback(path); };
1797 req.PartialReadDataPoint(path2, buffer2, 0, 2, 0, std::nullopt, cb);
1798 repo->SendRequest(req).Wait();
1804 metadata1[
"comment"] = std::string{
"foo"};
1805 metadata2[
"comment"] = std::string{
"bar"};
1807 EXPECT_CALL(callbacks, WriteMetaDataCallback(path1)).Times(1);
1808 EXPECT_CALL(callbacks, WriteMetaDataCallback(path2)).Times(1);
1810 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.WriteMetaDataCallback(path); };
1817 repo->SendRequest(req).Wait();
1824 EXPECT_CALL(callbacks, ReadMetaDataCallback(path1)).Times(1);
1825 EXPECT_CALL(callbacks, ReadMetaDataCallback(path2)).Times(1);
1827 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.ReadMetaDataCallback(path); };
1834 repo->SendRequest(req).Wait();
1840 EXPECT_CALL(callbacks, CreateSymlinkCallback(link1)).Times(1);
1841 EXPECT_CALL(callbacks, CreateSymlinkCallback(link2)).Times(1);
1843 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.CreateSymlinkCallback(path); };
1850 repo->SendRequest(req).Wait();
1856 EXPECT_CALL(callbacks, UpdateSymlinkCallback(link1)).Times(1);
1857 EXPECT_CALL(callbacks, UpdateSymlinkCallback(link2)).Times(1);
1859 auto cb = [&callbacks](
const DataPointPath& path) { callbacks.UpdateSymlinkCallback(path); };
1869 repo->SendRequest(req).Wait();
1879 testing::InSequence seq;
1880 EXPECT_CALL(callbacks, CreateCallback(path1)).Times(1);
1881 EXPECT_CALL(callbacks, CreateCallback(path2)).Times(1);
1883 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.CreateCallback(path); };
1886 callbacks.CreateCallback(path);
1890 repo->SendRequest(req2).Wait();
1896 repo->SendRequest(req1).Wait();
1906 testing::InSequence seq;
1907 EXPECT_CALL(callbacks, DeleteCallback(path1)).Times(1);
1908 EXPECT_CALL(callbacks, DeleteCallback(path2)).Times(1);
1910 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.DeleteCallback(path); };
1913 callbacks.DeleteCallback(path);
1916 repo->SendRequest(req2).Wait();
1923 repo->SendRequest(req1).Wait();
1930 bool result1, result2;
1934 testing::InSequence seq;
1935 EXPECT_CALL(callbacks, ExistsCallback(path1)).Times(1);
1936 EXPECT_CALL(callbacks, ExistsCallback(path2)).Times(1);
1938 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.ExistsCallback(path); };
1941 callbacks.ExistsCallback(path);
1944 repo->SendRequest(req2).Wait();
1951 repo->SendRequest(req1).Wait();
1959 std::pair<PathList, PathList> result1, result2;
1963 testing::InSequence seq;
1964 EXPECT_CALL(callbacks, GetChildrenCallback(path1)).Times(1);
1965 EXPECT_CALL(callbacks, GetChildrenCallback(path2)).Times(1);
1967 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.GetChildrenCallback(path); };
1970 callbacks.GetChildrenCallback(path);
1973 repo->SendRequest(req2).Wait();
1980 repo->SendRequest(req1).Wait();
1992 testing::InSequence seq;
1993 EXPECT_CALL(callbacks, WriteCallback(path1)).Times(1);
1994 EXPECT_CALL(callbacks, WriteCallback(path2)).Times(1);
1996 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.WriteCallback(path); };
1999 callbacks.WriteCallback(path);
2002 repo->SendRequest(req2).Wait();
2009 repo->SendRequest(req1).Wait();
2020 testing::InSequence seq;
2021 EXPECT_CALL(callbacks, ReadCallback(path1)).Times(1);
2022 EXPECT_CALL(callbacks, ReadCallback(path2)).Times(1);
2024 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.ReadCallback(path); };
2027 callbacks.ReadCallback(path);
2030 repo->SendRequest(req2).Wait();
2037 repo->SendRequest(req1).Wait();
2049 testing::InSequence seq;
2050 EXPECT_CALL(callbacks, WriteCallback(path1)).Times(1);
2051 EXPECT_CALL(callbacks, WriteCallback(path2)).Times(1);
2053 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.WriteCallback(path); };
2056 callbacks.WriteCallback(path);
2059 repo->SendRequest(req2).Wait();
2066 repo->SendRequest(req1).Wait();
2078 testing::InSequence seq;
2079 EXPECT_CALL(callbacks, ReadCallback(path1)).Times(1);
2080 EXPECT_CALL(callbacks, ReadCallback(path2)).Times(1);
2082 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.ReadCallback(path); };
2085 callbacks.ReadCallback(path);
2088 repo->SendRequest(req2).Wait();
2095 repo->SendRequest(req1).Wait();
2103 metadata1[
"comment"] = std::string{
"foo"};
2104 metadata2[
"comment"] = std::string{
"bar"};
2108 testing::InSequence seq;
2109 EXPECT_CALL(callbacks, WriteCallback(path1)).Times(1);
2110 EXPECT_CALL(callbacks, WriteCallback(path2)).Times(1);
2112 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.WriteCallback(path); };
2115 callbacks.WriteCallback(path);
2118 repo->SendRequest(req2).Wait();
2125 repo->SendRequest(req1).Wait();
2136 testing::InSequence seq;
2137 EXPECT_CALL(callbacks, ReadCallback(path1)).Times(1);
2138 EXPECT_CALL(callbacks, ReadCallback(path2)).Times(1);
2140 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.ReadCallback(path); };
2143 callbacks.ReadCallback(path);
2146 repo->SendRequest(req2).Wait();
2153 repo->SendRequest(req1).Wait();
2163 testing::InSequence seq;
2164 EXPECT_CALL(callbacks, CreateSymlinkCallback(link1)).Times(1);
2165 EXPECT_CALL(callbacks, CreateSymlinkCallback(link2)).Times(1);
2167 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.CreateSymlinkCallback(path); };
2170 callbacks.CreateSymlinkCallback(path);
2173 repo->SendRequest(req2).Wait();
2180 repo->SendRequest(req1).Wait();
2191 testing::InSequence seq;
2192 EXPECT_CALL(callbacks, UpdateSymlinkCallback(link1)).Times(1);
2193 EXPECT_CALL(callbacks, UpdateSymlinkCallback(link2)).Times(1);
2195 auto cb2 = [&callbacks](
const DataPointPath& path) { callbacks.UpdateSymlinkCallback(path); };
2198 callbacks.UpdateSymlinkCallback(path);
2201 repo->SendRequest(req2).Wait();
2208 repo->SendRequest(req0).Wait();
2213 repo->SendRequest(req1).Wait();
2221 repo = MakeRepository();
2222 repo->CreateDataPoint(
"/topdir/datapoint1"_dppath, 0);
2223 repo->CreateDataPoint(
"/topdir/subdir1/datapoint2"_dppath, 0);
2224 repo->CreateDataPoint(
"/topdir/subdir1/datapoint3"_dppath, 0);
2225 repo->CreateDataPoint(
"/topdir/subdir2/datapoint4"_dppath, 0);
2226 repo->CreateDataPoint(
"/topdir/subdir21/datapoint5"_dppath, 0);
2230 if (
repo->DataPointExists(
"/topdir/datapoint1"_dppath)) {
2231 repo->DeleteDataPoint(
"/topdir/datapoint1"_dppath);
2233 if (
repo->DataPointExists(
"/topdir/subdir1/datapoint2"_dppath)) {
2234 repo->DeleteDataPoint(
"/topdir/subdir1/datapoint2"_dppath);
2236 if (
repo->DataPointExists(
"/topdir/subdir1/datapoint2"_dppath)) {
2237 repo->DeleteDataPoint(
"/topdir/subdir1/datapoint2"_dppath);
2239 if (
repo->DataPointExists(
"/topdir/subdir1/datapoint3"_dppath)) {
2240 repo->DeleteDataPoint(
"/topdir/subdir1/datapoint3"_dppath);
2242 if (
repo->DataPointExists(
"/topdir/subdir2/datapoint4"_dppath)) {
2243 repo->DeleteDataPoint(
"/topdir/subdir2/datapoint4"_dppath);
2245 if (
repo->DataPointExists(
"/topdir/subdir21/datapoint5"_dppath)) {
2246 repo->DeleteDataPoint(
"/topdir/subdir21/datapoint5"_dppath);
2251 std::shared_ptr<RepositoryIf>
repo;
2255 auto [dps, paths] = repo->GetChildren(
"/"_dppath);
2256 EXPECT_THAT(dps, IsEmpty());
2257 EXPECT_THAT(paths, UnorderedElementsAreArray({
"/topdir"_dppath}));
2261 auto [dps, paths] = repo->GetChildren(
"/topdir"_dppath);
2262 EXPECT_THAT(dps, UnorderedElementsAreArray({
"/topdir/datapoint1"_dppath}));
2265 UnorderedElementsAreArray(
2266 {
"/topdir/subdir1"_dppath,
"/topdir/subdir2"_dppath,
"/topdir/subdir21"_dppath}));
2270 auto [dps, paths] = repo->GetChildren(
"/topdir/subdir1"_dppath);
2272 UnorderedElementsAreArray(
2273 {
"/topdir/subdir1/datapoint2"_dppath,
"/topdir/subdir1/datapoint3"_dppath}));
2274 EXPECT_THAT(paths, IsEmpty());
2278 auto [dps, paths] = repo->GetChildren(
"/topdir/subdir2"_dppath);
2279 EXPECT_THAT(dps, UnorderedElementsAreArray({
"/topdir/subdir2/datapoint4"_dppath}));
2280 EXPECT_THAT(paths, IsEmpty());
2284 auto [dps, paths] = repo->GetChildren(
"/topdir/datapoint1"_dppath);
2285 EXPECT_THAT(dps, IsEmpty());
2286 EXPECT_THAT(paths, IsEmpty());
2290 auto [dps, paths] = repo->GetChildren(
"/does/not/exist"_dppath);
2291 EXPECT_THAT(dps, IsEmpty());
2292 EXPECT_THAT(paths, IsEmpty());
2296 auto [dps, paths] = repo->GetChildren(
"/"_dppath,
true);
2298 UnorderedElementsAreArray({
"/topdir/datapoint1"_dppath,
2299 "/topdir/subdir1/datapoint2"_dppath,
2300 "/topdir/subdir1/datapoint3"_dppath,
2301 "/topdir/subdir2/datapoint4"_dppath,
2302 "/topdir/subdir21/datapoint5"_dppath}));
2304 UnorderedElementsAreArray({
"/topdir"_dppath,
2305 "/topdir/subdir1"_dppath,
2306 "/topdir/subdir2"_dppath,
2307 "/topdir/subdir21"_dppath}));
2311 repo->DeleteDataPoint(
"/"_dppath,
true);
2313 auto [dps, paths] = repo->GetChildren(
"/"_dppath,
true);
2314 EXPECT_THAT(dps, IsEmpty());
2315 EXPECT_THAT(paths, IsEmpty());
2319 repo->DeleteDataPoint(
"/topdir"_dppath,
true);
2321 auto [dps, paths] = repo->GetChildren(
"/"_dppath,
true);
2322 EXPECT_THAT(dps, IsEmpty());
2323 EXPECT_THAT(paths, IsEmpty());
2327 repo->DeleteDataPoint(
"/topdir/subdir2"_dppath,
true);
2329 auto [dps, paths] = repo->GetChildren(
"/"_dppath,
true);
2331 UnorderedElementsAreArray({
"/topdir/datapoint1"_dppath,
2332 "/topdir/subdir1/datapoint2"_dppath,
2333 "/topdir/subdir1/datapoint3"_dppath,
2334 "/topdir/subdir21/datapoint5"_dppath}));
2336 UnorderedElementsAreArray(
2337 {
"/topdir"_dppath,
"/topdir/subdir1"_dppath,
"/topdir/subdir21"_dppath}));
2345 repo = MakeRepository();
2346 path =
"/foo"_dppath;
2356 std::shared_ptr<RepositoryIf>
repo;
2362 int initial_value = 0;
2365 md[
"timestamp"] = t_start;
2366 md[
"comment"] = std::string{
"some comment"};
2367 md[
"units"] = std::string{
"bar"};
2373 repo->SendRequest(req).Wait();
2375 ASSERT_TRUE(md_read.
Contains(
"type"));
2376 ASSERT_TRUE(md_read.
Contains(
"shape"));
2377 ASSERT_TRUE(md_read.
Contains(
"timestamp"));
2378 ASSERT_TRUE(md_read.
Contains(
"comment"));
2379 ASSERT_TRUE(md_read.
Contains(
"units"));
2381 EXPECT_TRUE(md_read[
"type"].Cast<const std::type_info&>() ==
typeid(
int));
2382 EXPECT_EQ(md_read[
"shape"].Cast<RtcVectorUInt64>(),
RtcVectorUInt64{});
2383 EXPECT_EQ(md_read[
"timestamp"].Cast<RepositoryIf::Timestamp>(), t_start);
2384 EXPECT_EQ(md_read[
"comment"].Cast<std::string>(), std::string{
"some comment"});
2385 EXPECT_EQ(md_read[
"units"].Cast<std::string>(), std::string{
"bar"});
2390 int initial_value = 0;
2393 md[
"timestamp"] = t_start;
2394 md[
"comment"] = std::string{
"some comment"};
2395 md[
"units"] = std::string{
"bar"};
2402 repo->SendRequest(req).Wait();
2404 ASSERT_TRUE(md_read.
Contains(
"timestamp"));
2405 ASSERT_TRUE(md_read.
Contains(
"comment"));
2406 ASSERT_TRUE(md_read.
Contains(
"units"));
2408 EXPECT_EQ(md_read[
"timestamp"].Cast<RepositoryIf::Timestamp>(), t_start);
2409 EXPECT_EQ(md_read[
"comment"].Cast<std::string>(), std::string{
"some comment"});
2410 EXPECT_EQ(md_read[
"units"].Cast<std::string>(), std::string{
"bar"});
2415 int initial_value = 0;
2419 md[
"timestamp"] = t_start;
2420 md[
"comment"] = std::string{
"some comment"};
2421 md[
"units"] = std::string{
"bar"};
2427 repo->SendRequest(req).Wait();
2429 ASSERT_TRUE(md_read.
Contains(
"type"));
2430 ASSERT_TRUE(md_read.
Contains(
"shape"));
2431 ASSERT_TRUE(md_read.
Contains(
"timestamp"));
2432 ASSERT_TRUE(md_read.
Contains(
"comment"));
2433 ASSERT_TRUE(md_read.
Contains(
"units"));
2435 EXPECT_EQ(md_read[
"timestamp"].Cast<RepositoryIf::Timestamp>(), t_start);
2436 EXPECT_EQ(md_read[
"comment"].Cast<std::string>(), std::string{
"some comment"});
2437 EXPECT_EQ(md_read[
"units"].Cast<std::string>(), std::string{
"bar"});
2438 EXPECT_TRUE(md_read[
"type"].Cast<const std::type_info&>() ==
typeid(
int));
2439 EXPECT_EQ(md_read[
"shape"].Cast<RtcVectorUInt64>(),
RtcVectorUInt64{});
2443 int initial_value = 0;
2446 md[
"comment"] = std::string{
"some comment"};
2447 md[
"units"] = std::string{
"bar"};
2454 repo->SendRequest(req).Wait();
2456 ASSERT_TRUE(md_read.
Contains(
"comment"));
2457 ASSERT_TRUE(md_read.
Contains(
"units"));
2459 EXPECT_EQ(md_read[
"comment"].Cast<std::string>(), std::string{
"some comment"});
2460 EXPECT_EQ(md_read[
"units"].Cast<std::string>(), std::string{
"bar"});
2467 metadata[
"min"] =
static_cast<int>(-3);
2468 metadata[
"max"] =
static_cast<int>(3);
2469 metadata[
"text"] = std::string{
"This is a custom text description."};
2474 repo->SendRequest(req).Wait();
2475 ASSERT_TRUE(metadata_read.
Contains(
"min"));
2476 ASSERT_TRUE(metadata_read.
Contains(
"max"));
2477 EXPECT_EQ(metadata_read[
"min"].Cast<int>(), -3);
2478 EXPECT_EQ(metadata_read[
"max"].Cast<int>(), 3);
2479 EXPECT_EQ(metadata_read[
"text"].Cast<std::string>(), metadata[
"text"].Cast<std::string>());
2484 metadata[
"min"] =
static_cast<int>(-5);
2485 metadata[
"max"] =
static_cast<int>(5);
2486 metadata[
"text"] = std::string{
"This is another description."};
2487 metadata[
"new_field"] = std::string{
"A new field added."};
2492 repo->SendRequest(req).Wait();
2493 ASSERT_TRUE(metadata_read.
Contains(
"min"));
2494 ASSERT_TRUE(metadata_read.
Contains(
"max"));
2495 EXPECT_EQ(metadata_read[
"min"].Cast<int>(), -5);
2496 EXPECT_EQ(metadata_read[
"max"].Cast<int>(), 5);
2497 EXPECT_EQ(metadata_read[
"text"].Cast<std::string>(), metadata[
"text"].Cast<std::string>());
2503 metadata[
"min"] =
static_cast<int>(-7);
2504 metadata[
"max"] =
static_cast<int>(7);
2505 metadata[
"text"] = std::string{
"This is a description."};
2506 metadata.
Remove(
"new_field");
2511 repo->SendRequest(req).Wait();
2512 ASSERT_TRUE(metadata_read.
Contains(
"min"));
2513 ASSERT_TRUE(metadata_read.
Contains(
"max"));
2514 EXPECT_EQ(metadata_read[
"min"].Cast<int>(), -7);
2515 EXPECT_EQ(metadata_read[
"max"].Cast<int>(), 7);
2516 EXPECT_EQ(metadata_read[
"text"].Cast<std::string>(), metadata[
"text"].Cast<std::string>());
2523 metadata[
"min"] =
static_cast<int>(-9);
2524 metadata[
"max"] =
static_cast<int>(9);
2525 metadata[
"text"] = std::string{
"A description.\nBut on two lines."};
2526 metadata[
"new_field"] =
static_cast<int>(9);
2531 repo->SendRequest(req).Wait();
2532 ASSERT_TRUE(metadata_read.
Contains(
"min"));
2533 ASSERT_TRUE(metadata_read.
Contains(
"max"));
2534 EXPECT_EQ(metadata_read[
"min"].Cast<int>(), -9);
2535 EXPECT_EQ(metadata_read[
"max"].Cast<int>(), 9);
2536 EXPECT_EQ(metadata_read[
"text"].Cast<std::string>(), metadata[
"text"].Cast<std::string>());
2545 repo = MakeRepository();
2557 if (
repo->DataPointExists(
"/links/foo"_dppath)) {
2558 repo->DeleteDataPoint(
"/links/foo"_dppath);
2560 if (
repo->DataPointExists(
"/links/bar"_dppath)) {
2561 repo->DeleteDataPoint(
"/links/bar"_dppath);
2566 std::shared_ptr<RepositoryIf>
repo;
2576 bool foo_exists =
false;
2577 bool bar_exists =
false;
2578 bool foo_exists_later =
false;
2579 bool bar_exists_later =
false;
2581 repo->CreateDataPoint(target_path, int_create);
2595 repo->SendRequest(req).Wait();
2597 EXPECT_TRUE(foo_exists);
2598 EXPECT_TRUE(bar_exists);
2599 EXPECT_EQ(int_read, 0);
2600 EXPECT_EQ(int_read_2, 4);
2601 EXPECT_FALSE(foo_exists_later);
2602 EXPECT_FALSE(bar_exists_later);
2613 bool exists =
false;
2628 repo->SendRequest(req).Wait();
2630 EXPECT_FALSE(md_dp.
Contains(
"symlink_target"));
2631 EXPECT_TRUE(md_link.
Contains(
"symlink_target"));
2632 EXPECT_EQ(md_link[
"symlink_target"].Cast<DataPointPath>(),
DataPointPath{
"/foo"});
2634 EXPECT_EQ(int_read, 0);
2635 EXPECT_EQ(int_read_2, 4);
2636 EXPECT_TRUE(exists);
2642 bool link_exists_1 =
false;
2643 bool link_exists_2 =
true;
2651 repo->SendRequest(req).Wait();
2653 EXPECT_TRUE(link_exists_1);
2654 EXPECT_FALSE(link_exists_2);
2660 bool link_exists =
false;
2667 repo->SendRequest(req).Wait();
2670 EXPECT_TRUE(link_exists);
2678 EXPECT_NO_THROW(repo->DeleteDataPoint(link_path));
2684 bool link_exists =
false;
2691 repo->SendRequest(req).Wait();
2694 EXPECT_TRUE(link_exists);
2702 repo->CreateDataPoint(target_path, int_read);
2705 EXPECT_NO_THROW(repo->ReadDataPoint(link_path, int_read));
2710 DataPointPath dangling_target_path =
"/dangling_target"_dppath;
2712 bool link_exists =
false;
2719 repo->SendRequest(req).Wait();
2727 repo->SendRequest(req).Wait();
2730 EXPECT_NO_THROW(repo->ReadDataPoint(link_path, int_read));
2737 repo->SendRequest(req).Wait();
2749 bool link_exists =
false;
2757 repo->SendRequest(req).Wait();
2760 EXPECT_TRUE(link_exists);
2772 repo = MakeRepository();
2773 path =
"/foo"_dppath;
2791 std::shared_ptr<RepositoryIf>
repo;
2798 auto invalid_path =
"relative/dp/path"_dppath;
2825 auto create_value = 42;
2827 ASSERT_FALSE(repo->DataPointExists(path));
2829 repo->CreateDataPoint(path, create_value);
2830 ASSERT_TRUE(repo->DataPointExists(path));
2837 ASSERT_FALSE(repo->DataPointExists(path));
2843 ASSERT_FALSE(repo->DataPointExists(path));
2850 repo->CreateDataPoint(path, int_buffer);
2858 repo->CreateDataPoint(path, int_buffer);
2869 repo->CreateDataPoint(path, int_buffer);
2877 repo->CreateDataPoint(path, int_buffer);
2888 repo->CreateDataPoint(path, write_buffer);
2890 gsl::span<RtcInt64> read_buffer(write_buffer);
2891 auto too_small_read_buffer = read_buffer.subspan(0, 5);
2898 repo->CreateDataPoint(path, write_buffer);
2909 repo->CreateDataPoint(path, write_buffer);
2937 ASSERT_FALSE(repo->DataPointExists(path));
2946 ASSERT_FALSE(repo->DataPointExists(path));
2948 struct UnsupportedMetaDataType {};
2952 UnsupportedMetaDataType new_value;
2954 metadata[
"min"] = std::make_any<UnsupportedMetaDataType>(new_value);
2955 int initial_value = 12;
2958 repo->SendRequest(req).Wait();
2964 ASSERT_FALSE(repo->DataPointExists(path));
2966 repo->CreateDataPoint(path, 12);
2968 struct UnsupportedMetaDataType {};
2972 UnsupportedMetaDataType new_value;
2974 metadata[
"min"] = std::make_any<UnsupportedMetaDataType>(new_value);
2977 repo->SendRequest(req).Wait();
2983 ASSERT_FALSE(repo->DataPointExists(path));
2992 ASSERT_FALSE(repo->DataPointExists(path));
2993 repo->CreateDataPoint(path, 42);
2998 repo->SendRequest(req).Wait();
3007 ASSERT_FALSE(repo->DataPointExists(path));
3008 repo->CreateDataPoint(path, 42);
3016 ASSERT_FALSE(repo->DataPointExists(path));
3017 repo->CreateDataPoint(path, 42);
3023 repo->SendRequest(req).Wait();
3035 int initial_value = 0;
3040 repo->SendRequest(req).Wait();
3044 int write_value = 0;
3059 repo->SendRequest(req).Wait();
3070 bool exists =
false;
3079 repo->SendRequest(req).Wait();
3080 FAIL() <<
"Call did not throw";
3082 const auto& info = ex.
GetInfo();
3083 ASSERT_EQ(info.size(), 4);
3090 EXPECT_EQ(info[0].exception,
nullptr);
3091 ASSERT_NE(info[1].exception,
nullptr);
3092 ASSERT_NE(info[2].exception,
nullptr);
3093 EXPECT_EQ(info[3].exception,
nullptr);
3095 EXPECT_THROW(std::rethrow_exception(info[1].exception),
3097 EXPECT_THROW(std::rethrow_exception(info[2].exception),
3103 FAIL() <<
"Incorrect exception type";
3112 repo = MakeRepository();
3113 for (
unsigned i = 0; i < 500; i++) {
3114 std::string name = fmt::format(
"/test/datapoint_{:0>2}", i);
3120 for (
const auto& path :
dp_paths) {
3121 if (
repo->DataPointExists(path)) {
3122 repo->DeleteDataPoint(path);
3128 std::shared_ptr<RepositoryIf>
repo;
3135 std::vector<std::future<void>> futures;
3137 futures.reserve(dp_paths.size());
3138 for (
unsigned i = 0; i < dp_paths.size(); i++) {
3139 futures.emplace_back(std::async(std::launch::async, [
this, idx = i] {
3140 repo->CreateDataPoint(dp_paths[idx], idx);
3144 for (
auto& f : futures) {
3145 ASSERT_NO_THROW({ f.get(); });
3151 std::vector<std::future<bool>> futures;
3153 futures.reserve(dp_paths.size());
3154 for (
unsigned i = 0; i < dp_paths.size(); i++) {
3155 futures.emplace_back(std::async(std::launch::async, [
this, idx = i] {
3156 return repo->DataPointExists(dp_paths[idx]);
3160 for (
auto& f : futures) {
3161 bool result =
false;
3162 ASSERT_NO_THROW({ result = f.get(); });
3163 ASSERT_TRUE(result);
3169 std::vector<std::future<void>> futures;
3171 futures.reserve(dp_paths.size());
3172 for (
unsigned i = 0; i < dp_paths.size(); i++) {
3173 futures.emplace_back(std::async(std::launch::async, [
this, idx = i] {
3174 repo->SetDataPoint<
unsigned>(dp_paths[idx], idx + 1);
3178 for (
auto& f : futures) {
3179 ASSERT_NO_THROW({ f.get(); });
3185 std::vector<std::future<unsigned>> futures;
3187 futures.reserve(dp_paths.size());
3188 for (
unsigned i = 0; i < dp_paths.size(); i++) {
3189 futures.emplace_back(std::async(std::launch::async, [
this, idx = i] {
3190 return repo->GetDataPoint<
unsigned>(dp_paths[idx]);
3194 for (
unsigned i = 0; i < dp_paths.size(); i++) {
3195 unsigned result = 0;
3196 ASSERT_NO_THROW({ result = futures.at(i).get(); });
3197 EXPECT_EQ(result, i + 1);
3203 std::vector<std::future<void>> futures;
3205 futures.reserve(dp_paths.size());
3206 for (
unsigned i = 0; i < dp_paths.size(); i++) {
3207 futures.emplace_back(std::async(
3208 std::launch::async, [
this, idx = i] { repo->DeleteDataPoint(dp_paths[idx]); }));
3211 for (
auto& f : futures) {
3212 ASSERT_NO_THROW({ f.get(); });
3218 std::vector<std::future<bool>> futures;
3220 futures.reserve(dp_paths.size());
3221 for (
unsigned i = 0; i < dp_paths.size(); i++) {
3222 futures.emplace_back(std::async(std::launch::async, [
this, idx = i] {
3223 return repo->DataPointExists(dp_paths[idx]);
3227 for (
auto& f : futures) {
3229 ASSERT_NO_THROW({ result = f.get(); });
3230 ASSERT_FALSE(result);
3236 auto path = dp_paths[0];
3237 unsigned create_value = 42;
3238 repo->CreateDataPoint(path, create_value);
3241 std::vector<std::future<unsigned>> futures;
3243 futures.reserve(500);
3244 for (
unsigned i = 0; i < 500; i++) {
3245 futures.emplace_back(
3246 std::async(std::launch::async, [&] {
return repo->GetDataPoint<
unsigned>(path); }));
3249 for (
auto& f : futures) {
3251 ASSERT_NO_THROW({ result = f.get(); });
3252 EXPECT_EQ(result, create_value);
3258 auto path = dp_paths[0];
3259 unsigned create_value = 42;
3260 repo->CreateDataPoint(path, create_value);
3263 std::vector<std::future<void>> futures;
3265 futures.reserve(500);
3266 for (
unsigned i = 0; i < 500; i++) {
3267 futures.emplace_back(
3268 std::async(std::launch::async, [&] { repo->SetDataPoint<
unsigned>(path, 43); }));
3271 for (
auto& f : futures) {
3272 ASSERT_NO_THROW({ f.get(); });
3280 repo->SendRequest(req).Wait();
3282 EXPECT_EQ(result, 43);
3283 EXPECT_EQ(md[
"sequence_id"].Cast<RtcUInt64>(), 500);
3287 auto path = dp_paths[0];
3288 unsigned create_value = 42;
3289 repo->CreateDataPoint(path, create_value);
3292 std::vector<std::future<void>> futures;
3294 futures.reserve(50);
3295 for (
unsigned i = 0; i < 50; i++) {
3296 futures.emplace_back(std::async(std::launch::async, [&] {
3297 unsigned buffer = 43;
3299 for (
unsigned j = 0; j < 10; j++) {
3302 repo->SendRequest(req).Wait();
3306 for (
auto& f : futures) {
3307 ASSERT_NO_THROW({ f.get(); });
3315 repo->SendRequest(req).Wait();
3317 EXPECT_EQ(result, 43);
3318 EXPECT_EQ(md[
"sequence_id"].Cast<RtcUInt64>(), 500);
3322 auto path = dp_paths[0];
3323 unsigned create_value = 42;
3324 repo->CreateDataPoint(path, create_value);
3327 std::vector<std::future<unsigned>> futures;
3329 futures.reserve(50);
3330 for (
unsigned i = 0; i < 50; i++) {
3331 futures.emplace_back(std::async(std::launch::async, [&] {
3332 unsigned buffer = 0;
3344 repo->SendRequest(req).Wait();
3349 for (
auto& f : futures) {
3350 unsigned result = 0;
3351 ASSERT_NO_THROW({ result = f.get(); });
3352 EXPECT_EQ(result, 42);
3362 repo = MakeRepository();
3363 for (
unsigned i = 0; i < 500; i++) {
3364 std::string name = fmt::format(
"/test/datapoint_{:0>2}", i);
3370 for (
const auto& path :
dp_paths) {
3371 if (
repo->DataPointExists(path)) {
3372 repo->DeleteDataPoint(path);
3379 std::shared_ptr<RepositoryIf>
repo;
3384 ASSERT_FALSE(repo->DataPointExists(path));
3385 EXPECT_THROW({ repo->CreateDataPoint<
ThrowInGetShape>(path); }, std::runtime_error);
3387 ASSERT_FALSE(repo->DataPointExists(second_path));
3388 EXPECT_THROW({ repo->CreateDataPoint<
ThrowInGetShape>(second_path); }, std::runtime_error);
3393 ASSERT_FALSE(repo->DataPointExists(path));
3394 EXPECT_THROW({ repo->CreateDataPoint<
ThrowInMakeSpan>(path); }, std::runtime_error);
3396 ASSERT_FALSE(repo->DataPointExists(second_path));
3397 EXPECT_THROW({ repo->CreateDataPoint<
ThrowInMakeSpan>(second_path); }, std::runtime_error);
3402 ASSERT_FALSE(repo->DataPointExists(path));
3408 std::runtime_error);
3410 ASSERT_FALSE(repo->DataPointExists(second_path));
3416 std::runtime_error);
This class provides a wrapper for a data point path.
Definition dataPointPath.hpp:76
A buffer class representing 2D matrix data.
Definition matrixBuffer.hpp:27
A span referencing a 2D matrix buffer.
Definition matrixSpan.hpp:35
Definition repositoryIf.hpp:94
An object representing one or more asynchronous I/O requests to a repository.
Definition repositoryIf.hpp:638
void DataPointExists(const DataPointPath &path, bool &result, const CallbackType &callback=nullptr) const
Definition repositoryIf.cpp:350
void WriteDataPoint(const DataPointPath &path, const T &buffer, std::optional< std::reference_wrapper< MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr)
Add request to write a datapoint.
Definition repositoryIf.ipp:1557
void DeleteDataPoint(const DataPointPath &path, const CallbackType &callback=nullptr)
Definition repositoryIf.cpp:344
void ReadDataPoint(const DataPointPath &path, T &buffer, std::optional< std::reference_wrapper< MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr) const
Definition repositoryIf.ipp:1459
void GetChildren(const DataPointPath &path, std::pair< PathList, PathList > &result, bool recurse=false, const CallbackType &callback=nullptr) const
Add request to query the child datapoints and paths for a given parent path.
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
Add request to partially read a datapoint.
Definition repositoryIf.ipp:1614
void ReadMetaData(const DataPointPath &path, MetaData &metadata, const CallbackType &callback=nullptr) const
Definition repositoryIf.cpp:372
void CreateSymlink(const DataPointPath &dp, const DataPointPath &link, const CallbackType &callback=nullptr)
Definition repositoryIf.cpp:388
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)
Add request to partially write a datapoint.
Definition repositoryIf.ipp:1701
void CreateDataPoint(const DataPointPath &path, const T &initial_value, std::optional< std::reference_wrapper< const MetaData > > metadata=std::nullopt, const CallbackType &callback=nullptr)
Add a request to create a new datapoint.
Definition repositoryIf.ipp:1400
void UpdateSymlink(const DataPointPath &dp, const DataPointPath &link, const CallbackType &callback=nullptr)
Definition repositoryIf.cpp:397
void WriteMetaData(const DataPointPath &path, const MetaData &metadata, const CallbackType &callback=nullptr)
Definition repositoryIf.cpp:380
Definition repositoryIf.hpp:89
Definition repositoryIf.hpp:85
Definition repositoryIf.hpp:81
Definition repositoryIf.hpp:77
Definition repositoryIf.hpp:73
Definition repositoryIf.hpp:102
const std::vector< Info > & GetInfo() const
Definition repositoryIf.cpp:139
@ Success
Definition repositoryIf.hpp:104
@ Failed
Definition repositoryIf.hpp:104
Definition repositoryIf.hpp:98
Abstract interface providing basic read and write facilities to a repository.
Definition repositoryIf.hpp:50
std::optional< T > TryGetDataPoint(const DataPointPath &path) const
Fetches a datapoint from the repository.
Definition repositoryIf.ipp:1882
Clock::time_point Timestamp
Definition repositoryIf.hpp:57
T GetDataPoint(const DataPointPath &path) const
Fetches a datapoint from the repository.
Definition repositoryIf.ipp:1864
void CreateDataPoint(const DataPointPath &path)
Creates a new empty datapoint in the repository.
Definition repositoryIf.ipp:1847
void SetDataPoint(const DataPointPath &path, const T &value)
Sets a datapoint in the repository.
Definition repositoryIf.ipp:1890
std::vector< DataPointPath > PathList
Definition repositoryIf.hpp:55
Definition repositoryIfTestSuite.hpp:755
T MakeWriteValueForPartialIo()
Definition repositoryIfTestSuite.hpp:877
T MakeReadValueForPartialIo(const T &result_value)
Definition repositoryIfTestSuite.hpp:991
T MakeExpectedResultValueForPartialRead()
Definition repositoryIfTestSuite.hpp:947
T MakeExpectedResultValueForPartialReadEnd()
Definition repositoryIfTestSuite.hpp:969
T MakeLargeTestValue()
Definition repositoryIfTestSuite.hpp:757
T MakeSmallTestValue()
Definition repositoryIfTestSuite.hpp:793
T MakeCreateValueForPartialIo()
Definition repositoryIfTestSuite.hpp:829
RtcVectorUInt64 ExpectedSmallTestValueShape()
Definition repositoryIfTestSuite.hpp:811
T MakeExpectedResultValueForPartialWrite()
Definition repositoryIfTestSuite.hpp:899
RtcVectorUInt64 ExpectedLargeTestValueShape()
Definition repositoryIfTestSuite.hpp:775
Definition repositoryIfTestSuite.hpp:1611
void TearDown() override
Definition repositoryIfTestSuite.hpp:1621
DataPointPath link1
Definition repositoryIfTestSuite.hpp:1648
DataPointPath path1
Definition repositoryIfTestSuite.hpp:1646
DataPointPath link2
Definition repositoryIfTestSuite.hpp:1649
void SetupDataPoints(const T &initial_value=0)
Definition repositoryIfTestSuite.hpp:1637
DataPointPath path2
Definition repositoryIfTestSuite.hpp:1647
std::shared_ptr< RepositoryIf > repo
Definition repositoryIfTestSuite.hpp:1645
void SetUp() override
Definition repositoryIfTestSuite.hpp:1613
Definition repositoryIfTestSuite.hpp:3359
void SetUp() override
Definition repositoryIfTestSuite.hpp:3361
std::vector< DataPointPath > dp_paths
Definition repositoryIfTestSuite.hpp:3378
std::shared_ptr< RepositoryIf > repo
Definition repositoryIfTestSuite.hpp:3379
void TearDown() override
Definition repositoryIfTestSuite.hpp:3369
Definition repositoryIfTestSuite.hpp:2769
std::shared_ptr< RepositoryIf > repo
Definition repositoryIfTestSuite.hpp:2791
void TearDown() override
Definition repositoryIfTestSuite.hpp:2778
DataPointPath link_path
Definition repositoryIfTestSuite.hpp:2793
void SetUp() override
Definition repositoryIfTestSuite.hpp:2771
DataPointPath link_path2
Definition repositoryIfTestSuite.hpp:2794
DataPointPath path
Definition repositoryIfTestSuite.hpp:2792
Definition repositoryIfTestSuite.hpp:2218
void TearDown() override
Definition repositoryIfTestSuite.hpp:2229
std::shared_ptr< RepositoryIf > repo
Definition repositoryIfTestSuite.hpp:2251
void SetUp() override
Definition repositoryIfTestSuite.hpp:2220
Definition repositoryIfTestSuite.hpp:3109
void TearDown() override
Definition repositoryIfTestSuite.hpp:3119
std::shared_ptr< RepositoryIf > repo
Definition repositoryIfTestSuite.hpp:3128
std::vector< DataPointPath > dp_paths
Definition repositoryIfTestSuite.hpp:3129
void SetUp() override
Definition repositoryIfTestSuite.hpp:3111
Definition repositoryIfTestSuite.hpp:1652
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:182
std::vector< DataPointPath > dp_paths
Definition repositoryIfTestSuite.hpp:269
T MakeSomeTestValue()
Definition repositoryIfTestSuite.hpp:202
void SetUp() override
Definition repositoryIfTestSuite.hpp:184
std::shared_ptr< RepositoryIf > repo
Definition repositoryIfTestSuite.hpp:270
size_t GetExpectedSize(const U &value)
Definition repositoryIfTestSuite.hpp:257
void TearDown() override
Definition repositoryIfTestSuite.hpp:193
T MakeOtherTestValue()
Definition repositoryIfTestSuite.hpp:228
Definition repositoryIfTestSuite.hpp:2542
DataPointPath target_path
Definition repositoryIfTestSuite.hpp:2567
void SetUp() override
Definition repositoryIfTestSuite.hpp:2544
void TearDown() override
Definition repositoryIfTestSuite.hpp:2550
DataPointPath target_path_2
Definition repositoryIfTestSuite.hpp:2568
std::shared_ptr< RepositoryIf > repo
Definition repositoryIfTestSuite.hpp:2566
virtual RtcVectorUInt64 GetShape() const
Definition repositoryIfTestSuite.hpp:42
TestingUserTypeBase(std::string value)
Definition repositoryIfTestSuite.hpp:40
virtual gsl::span< char > MakeSpan()
Definition repositoryIfTestSuite.hpp:46
std::string m_value
Definition repositoryIfTestSuite.hpp:62
virtual bool ResizeBuffer(const RtcVectorUInt64 &shape)
Definition repositoryIfTestSuite.hpp:53
TestingUserTypeBase()=default
virtual gsl::span< const char > MakeSpan() const
Definition repositoryIfTestSuite.hpp:49
Definition repositoryIfTestSuite.hpp:65
RtcVectorUInt64 GetShape() const override
Definition repositoryIfTestSuite.hpp:68
TestingUserTypeBase()=default
Definition repositoryIfTestSuite.hpp:73
gsl::span< char > MakeSpan() override
Definition repositoryIfTestSuite.hpp:76
gsl::span< const char > MakeSpan() const override
Definition repositoryIfTestSuite.hpp:79
TestingUserTypeBase()=default
Definition repositoryIfTestSuite.hpp:84
bool ResizeBuffer(const RtcVectorUInt64 &shape) override
Definition repositoryIfTestSuite.hpp:87
TestingUserTypeBase()=default
constexpr bool IS_VECTOR_TYPE
Is true if the type is a std::vector<U> of some type U.
Definition typeTraits.hpp:46
constexpr bool IS_MATRIX_BUFFER_TYPE
Is true if the type is a MatrixBuffer<U> of some type U.
Definition typeTraits.hpp:76
Definition measurable.hpp:25
RtcUInt64 GetNumOfElements(const RtcVectorUInt64 &shape)
Definition repositoryIf.ipp:135
Definition fakeClock.cpp:14
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:279
::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:1002
TEST_F(Callbacks, CreateDataPointCallback)
Definition repositoryIfTestSuite.hpp:1668
RepositoryIfTestSuite< T > BasicOperation
Definition repositoryIfTestSuite.hpp:276
TYPED_TEST(BasicOperation, DataPointExistanceConsistency)
Definition repositoryIfTestSuite.hpp:320
RepositoryIf::PathList PathList
Definition persistentRepoAdapter.cpp:95
Definition commandReplier.cpp:21
std::int64_t RtcInt64
Definition basicTypes.hpp:40
RtcMatrix< RtcInt8 > RtcMatrixInt8
Definition basicTypes.hpp:62
std::int16_t RtcInt16
Definition basicTypes.hpp:38
std::uint16_t RtcUInt16
Definition basicTypes.hpp:42
float RtcFloat
Definition basicTypes.hpp:45
RtcMatrix< RtcInt32 > RtcMatrixInt32
Definition basicTypes.hpp:64
std::int32_t RtcInt32
Definition basicTypes.hpp:39
std::int8_t RtcInt8
Definition basicTypes.hpp:37
RtcMatrix< RtcInt64 > RtcMatrixInt64
Definition basicTypes.hpp:65
RtcMatrix< RtcUInt64 > RtcMatrixUInt64
Definition basicTypes.hpp:69
RtcVector< RtcUInt32 > RtcVectorUInt32
Definition basicTypes.hpp:56
RtcMatrix< RtcUInt8 > RtcMatrixUInt8
Definition basicTypes.hpp:66
RtcMatrix< RtcString > RtcMatrixString
Definition basicTypes.hpp:72
RtcMatrix< RtcFloat > RtcMatrixFloat
Definition basicTypes.hpp:70
RtcVector< RtcDouble > RtcVectorDouble
Definition basicTypes.hpp:59
std::string RtcString
Definition basicTypes.hpp:47
RtcMatrix< RtcInt16 > RtcMatrixInt16
Definition basicTypes.hpp:63
RtcMatrix< RtcDouble > RtcMatrixDouble
Definition basicTypes.hpp:71
bool RtcBool
Definition basicTypes.hpp:36
RtcVector< RtcUInt16 > RtcVectorUInt16
Definition basicTypes.hpp:55
std::uint32_t RtcUInt32
Definition basicTypes.hpp:43
RtcVector< RtcInt16 > RtcVectorInt16
Definition basicTypes.hpp:51
RtcMatrix< RtcBool > RtcMatrixBool
Definition basicTypes.hpp:61
RtcVector< RtcFloat > RtcVectorFloat
Definition basicTypes.hpp:58
RtcVector< RtcInt8 > RtcVectorInt8
Definition basicTypes.hpp:50
std::uint8_t RtcUInt8
Definition basicTypes.hpp:41
RtcVector< RtcBool > RtcVectorBool
Definition basicTypes.hpp:49
RtcVector< RtcUInt64 > RtcVectorUInt64
Definition basicTypes.hpp:57
std::uint64_t RtcUInt64
Definition basicTypes.hpp:44
RtcVector< RtcString > RtcVectorString
Definition basicTypes.hpp:60
RtcVector< RtcInt32 > RtcVectorInt32
Definition basicTypes.hpp:52
std::vector< std::byte > RtcBinary
Definition basicTypes.hpp:48
RtcVector< RtcUInt8 > RtcVectorUInt8
Definition basicTypes.hpp:54
RtcMatrix< RtcUInt16 > RtcMatrixUInt16
Definition basicTypes.hpp:67
RtcVector< RtcInt64 > RtcVectorInt64
Definition basicTypes.hpp:53
RtcMatrix< RtcUInt32 > RtcMatrixUInt32
Definition basicTypes.hpp:68
double RtcDouble
Definition basicTypes.hpp:46
Definition ddsSub.hpp:155
Header file for RepositoryIf and related base classes.
static RtcVectorUInt64 GetShape(const BufferType &buffer)
Definition repositoryIfTestSuite.hpp:129
static bool ResizeBuffer(BufferType &buffer, const RtcVectorUInt64 &shape)
Definition repositoryIfTestSuite.hpp:141
test::ThrowInResizeBuffer BufferType
Definition repositoryIfTestSuite.hpp:123
std::remove_cv_t< typename std::string::value_type > ElementType
Definition repositoryIfTestSuite.hpp:124
RtcString DataPointType
Definition repositoryIfTestSuite.hpp:125
static gsl::span< ElementType > MakeSpan(BufferType &buffer)
Definition repositoryIfTestSuite.hpp:133
static gsl::span< const ElementType > MakeSpan(const BufferType &buffer)
Definition repositoryIfTestSuite.hpp:137
static const bool USES_TEMP_BUFFER
Definition repositoryIfTestSuite.hpp:126
void TempBufferType
Definition repositoryIfTestSuite.hpp:127
static const bool USES_TEMP_BUFFER
Definition repositoryIfTestSuite.hpp:151
static gsl::span< ElementType > MakeSpan(BufferType &buffer)
Definition repositoryIfTestSuite.hpp:158
static RtcVectorUInt64 GetShape(const BufferType &buffer)
Definition repositoryIfTestSuite.hpp:154
RtcString DataPointType
Definition repositoryIfTestSuite.hpp:150
void TempBufferType
Definition repositoryIfTestSuite.hpp:152
static bool ResizeBuffer(BufferType &buffer, const RtcVectorUInt64 &shape)
Definition repositoryIfTestSuite.hpp:166
test::ThrowInGetShape BufferType
Definition repositoryIfTestSuite.hpp:148
static gsl::span< const ElementType > MakeSpan(const BufferType &buffer)
Definition repositoryIfTestSuite.hpp:162
std::remove_cv_t< typename std::string::value_type > ElementType
Definition repositoryIfTestSuite.hpp:149
static const bool USES_TEMP_BUFFER
Definition repositoryIfTestSuite.hpp:101
static gsl::span< ElementType > MakeSpan(BufferType &buffer)
Definition repositoryIfTestSuite.hpp:108
void TempBufferType
Definition repositoryIfTestSuite.hpp:102
RtcString DataPointType
Definition repositoryIfTestSuite.hpp:100
static gsl::span< const ElementType > MakeSpan(const BufferType &buffer)
Definition repositoryIfTestSuite.hpp:112
static bool ResizeBuffer(BufferType &buffer, const RtcVectorUInt64 &shape)
Definition repositoryIfTestSuite.hpp:116
test::ThrowInMakeSpan BufferType
Definition repositoryIfTestSuite.hpp:98
char ElementType
Definition repositoryIfTestSuite.hpp:99
static RtcVectorUInt64 GetShape(const BufferType &buffer)
Definition repositoryIfTestSuite.hpp:104
Definition repositoryIf.ipp:152
MatrixSpan< T > SpanType
Definition repositoryIfTestSuite.hpp:1286
MatrixBuffer< T, A > BufferType
Definition repositoryIfTestSuite.hpp:1285
MatrixSpan< const T > ConstSpanType
Definition repositoryIfTestSuite.hpp:1287
boost::container::vector< bool, A > BufferType
Definition repositoryIfTestSuite.hpp:1306
MatrixSpan< const bool > ConstSpanType
Definition repositoryIfTestSuite.hpp:1308
MatrixSpan< bool > SpanType
Definition repositoryIfTestSuite.hpp:1307
gsl::span< char > SpanType
Definition repositoryIfTestSuite.hpp:1279
RtcString BufferType
Definition repositoryIfTestSuite.hpp:1278
gsl::span< const char > ConstSpanType
Definition repositoryIfTestSuite.hpp:1280
gsl::span< const T > ConstSpanType
Definition repositoryIfTestSuite.hpp:1294
std::vector< T, A > BufferType
Definition repositoryIfTestSuite.hpp:1292
gsl::span< T > SpanType
Definition repositoryIfTestSuite.hpp:1293
gsl::span< const bool > ConstSpanType
Definition repositoryIfTestSuite.hpp:1301
boost::container::vector< bool, A > BufferType
Definition repositoryIfTestSuite.hpp:1299
gsl::span< bool > SpanType
Definition repositoryIfTestSuite.hpp:1300
Definition repositoryIfTestSuite.hpp:1274
Provides useful mechanisms to test various type traits.