22 lines
579 B
C++
22 lines
579 B
C++
#include <Void/Net/Socket.hpp>
|
|
#include <Void/Testing/Assert.hpp>
|
|
#include <Void/Testing/Test.hpp>
|
|
|
|
#include <chrono>
|
|
#include <utility>
|
|
|
|
Void::Testing::Test udp_socket_default_is_closed()
|
|
{
|
|
Void::Net::UdpSocket socket;
|
|
Void::Testing::expect(!socket.valid());
|
|
Void::Testing::expect(!socket.wait_readable(std::chrono::milliseconds{0}));
|
|
}
|
|
|
|
Void::Testing::Test udp_socket_move_preserves_closed_state()
|
|
{
|
|
Void::Net::UdpSocket source;
|
|
Void::Net::UdpSocket destination = std::move(source);
|
|
Void::Testing::expect(!source.valid());
|
|
Void::Testing::expect(!destination.valid());
|
|
}
|