WIP: Unit test

This commit is contained in:
Tristan B. Kildaire 2022-05-10 08:30:12 +02:00
parent 80d96c20a5
commit e988fb7192
1 changed files with 30 additions and 0 deletions

View File

@ -176,4 +176,34 @@ public bool sendMessage(Socket recipient, byte[] message)
/* TODO: Compact this */
return bytesSent > 0;
}
/* TODO: Make this test encoding etc. (URGENT TEST CASE TO ADD) */
unittest
{
Socket servServ = new Socket(AddressFamily.INET, SocketType.STREAM, ProtocolType.TCP);
servServ.bind(parseAddress("127.0.0.1", 0));
ushort serverPort = to!(ushort)(servServ.localAddress.toPortString());
class Client : Thread
{
Socket client;
this(Socket client)
{
super(&worker);
this.client = client;
start();
}
private void worker()
{
}
}
while(true)
{
servServ.accept().
}
}