Skip to content

Commit 4896c07

Browse files
committed
Unit tests: better diagnostics in tcpserver test
1 parent 4127077 commit 4896c07

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

testing/int/tcpserver.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ auto with_read_callback(const char *name, std::function<void(const std::string &
9191
}
9292

9393
void check_streamfeed_100_response(const std::string &res) {
94-
REQUIRE(res.substr(0, 3) == "\x7f\x01\x09");
95-
auto info_len = static_cast<std::size_t>((res[5] << 8) | res[4]);
96-
REQUIRE(res.size() > 6 + info_len);
94+
REQUIRE(res.substr(0, 4) == "\x7f\x01\x09\2");
95+
INFO(bytes_to_hexstr(res.substr(0, 10)));
96+
auto info_len = *reinterpret_cast<const uint16_t*>(res.data() + 4);
97+
98+
REQUIRE(static_cast<int>(res.size()) > 6 + info_len);
9799

98100
auto info = lsl::stream_info_impl();
99101
info.from_fullinfo_message(res.substr(6, info_len));

0 commit comments

Comments
 (0)