mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-08 19:10:42 +02:00
fixed failed tests
This commit is contained in:
parent
f902bb06ad
commit
2bec476b4f
@ -90,18 +90,13 @@ class UdpRxSocket {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char *LastPacket() const noexcept { return buff; }
|
const char *LastPacket() const noexcept { return buff; }
|
||||||
//constexpr
|
ssize_t getPacketSize() const noexcept { return packet_size; }
|
||||||
ssize_t getPacketSize() const noexcept { return packet_size; }
|
|
||||||
|
bool ReceivePacket() noexcept { return ReceivePacket(buff); }
|
||||||
bool ReceivePacket() noexcept {
|
|
||||||
auto bytes_received =
|
|
||||||
recvfrom(fd, buff, packet_size, 0, nullptr, nullptr);
|
|
||||||
return bytes_received == packet_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ReceivePacket(char *dst) noexcept {
|
bool ReceivePacket(char *dst) noexcept {
|
||||||
auto bytes_received =
|
auto bytes_received =
|
||||||
recvfrom(fd, buff, packet_size, 0, nullptr, nullptr);
|
recvfrom(fd, dst, packet_size, 0, nullptr, nullptr);
|
||||||
return bytes_received == packet_size;
|
return bytes_received == packet_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ TEST_CASE("Shutdown socket without hanging when waiting for data") {
|
|||||||
&sls::UdpRxSocket::ReceivePacket),
|
&sls::UdpRxSocket::ReceivePacket),
|
||||||
&s);
|
&s);
|
||||||
|
|
||||||
s.Close();
|
s.Shutdown();
|
||||||
auto r = ret.get();
|
auto r = ret.get();
|
||||||
|
|
||||||
CHECK(r == false); // since we didn't get the packet
|
CHECK(r == false); // since we didn't get the packet
|
||||||
|
Loading…
x
Reference in New Issue
Block a user