Skip to content

Commit 195fc82

Browse files
committed
Unit tests: test retrieving the fullinfo
1 parent 2184516 commit 195fc82

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

testing/test_ext_discovery.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,19 @@ TEST_CASE("Invalid queries are caught before sending the query", "[resolver][str
2727
REQUIRE_THROWS(lsl::resolve_stream("invalid'query", 0, 0.1));
2828
}
2929

30+
TEST_CASE("fullinfo", "[inlet][fullinfo][basic]") {
31+
lsl::stream_info info("fullinfo", "unittest", 1, 1, lsl::cf_int8, "fullinfo1234");
32+
const std::string extinfo("contents\nwith\n\tnewlines");
33+
info.desc().append_child_value("info", extinfo);
34+
lsl::stream_outlet outlet(info);
35+
auto found_streams = lsl::resolve_stream("name", info.name(), 1, 2);
36+
REQUIRE(!found_streams.empty());
37+
INFO(found_streams[0].as_xml())
38+
CHECK(found_streams[0].desc().first_child().empty());
39+
auto fullinfo = lsl::stream_inlet(found_streams[0]).info(2);
40+
INFO(fullinfo.as_xml())
41+
CHECK(fullinfo.desc().child_value("info") == extinfo);
42+
}
43+
44+
3045
} // namespace

0 commit comments

Comments
 (0)