1 #include <catch2/catch_all.hpp>
12 using namespace std::chrono;
13 using namespace std::chrono_literals;
15 TEST_CASE(
"Test many IO connections after crossing Leon processors") {
24 camRgb->preview.link(xout->input);
29 this_thread::sleep_for(5s);
32 std::unordered_map<string, int> numFrames;
40 constexpr
auto NUM_FRAMES_REQUIRED = 10;
42 bool receivedEnoughFrames =
true;
43 auto t1 = steady_clock::now();
45 receivedEnoughFrames =
true;
51 if(frame !=
nullptr) {
56 if(numFrames[out] < NUM_FRAMES_REQUIRED) {
57 receivedEnoughFrames =
false;
61 if(receivedEnoughFrames) {
64 }
while(steady_clock::now() - t1 < 5s);
66 cout <<
"numFrames: ";
69 cout << numFrames[out] <<
", ";
73 REQUIRE(receivedEnoughFrames ==
true);
76 TEST_CASE(
"Test many IO connections before crossing Leon processors") {
84 camRgb->preview.link(manip->inputImage);
87 manip->out.link(xout->input);
93 std::unordered_map<string, int> numFrames;
101 constexpr
auto NUM_FRAMES_REQUIRED = 10;
103 bool receivedEnoughFrames =
false;
104 auto t1 = steady_clock::now();
106 receivedEnoughFrames =
true;
111 if(frame !=
nullptr) {
116 if(numFrames[out] < NUM_FRAMES_REQUIRED) {
117 receivedEnoughFrames =
false;
121 if(receivedEnoughFrames) {
125 }
while(steady_clock::now() - t1 < 5s);
127 cout <<
"numFrames: ";
130 cout << numFrames[out] <<
", ";
134 REQUIRE(receivedEnoughFrames ==
true);