@@ -32,10 +32,11 @@ TEMPLATE_TEST_CASE("pushpull", "[basic][throughput]", char, double, std::string)
32
32
auto found_stream_info (lsl::resolve_stream (" name" , name, 1 , 2.0 ));
33
33
REQUIRE (!found_stream_info.empty ());
34
34
35
- std::list<lsl::stream_inlet> inlet_list;
36
35
for (auto n_inlets : param_inlets) {
36
+ std::list<lsl::stream_inlet> inlet_list;
37
37
while (inlet_list.size () < n_inlets) {
38
- inlet_list.emplace_front (found_stream_info[0 ], 300 , false );
38
+ lsl::stream_info info_copy (found_stream_info[0 ]);
39
+ inlet_list.emplace_front (info_copy, 300 , false );
39
40
inlet_list.front ().open_stream (.5 );
40
41
}
41
42
std::string suffix (std::to_string (nchan) + " _inlets_" + std::to_string (n_inlets));
@@ -49,7 +50,20 @@ TEMPLATE_TEST_CASE("pushpull", "[basic][throughput]", char, double, std::string)
49
50
out.push_chunk_multiplexed (data, chunk_size);
50
51
for (auto &inlet : inlet_list) inlet.flush ();
51
52
};
53
+
54
+ // Explicitly close and delete the inlets to ensure that they are not
55
+ // still in use when the next inlet is created.
56
+ for (int i = 0 ; i < n_inlets; i++) {
57
+ inlet_list.back ().close_stream ();
58
+ inlet_list.pop_back ();
59
+ }
60
+
52
61
}
62
+ // Wait until all inlets are closed
63
+ // this hangs forever
64
+ // while (out.have_consumers()) {
65
+ // std::this_thread::sleep_for(std::chrono::milliseconds(1));
66
+ // }
53
67
}
54
68
}
55
69
0 commit comments