Skip to content

Commit e37971c

Browse files
committed
Just testing...
1 parent 1c7ccec commit e37971c

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

testing/ext/bench_pushpull.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ TEMPLATE_TEST_CASE("pushpull", "[basic][throughput]", char, double, std::string)
3232
auto found_stream_info(lsl::resolve_stream("name", name, 1, 2.0));
3333
REQUIRE(!found_stream_info.empty());
3434

35-
std::list<lsl::stream_inlet> inlet_list;
3635
for (auto n_inlets : param_inlets) {
36+
std::list<lsl::stream_inlet> inlet_list;
3737
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);
3940
inlet_list.front().open_stream(.5);
4041
}
4142
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)
4950
out.push_chunk_multiplexed(data, chunk_size);
5051
for (auto &inlet : inlet_list) inlet.flush();
5152
};
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+
5261
}
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+
// }
5367
}
5468
}
5569

0 commit comments

Comments
 (0)