summary refs log tree commit diff stats
path: root/tests/async
diff options
context:
space:
mode:
Diffstat (limited to 'tests/async')
-rw-r--r--tests/async/tasyncawait.nim5
-rw-r--r--tests/async/tnewasyncudp.nim5
-rw-r--r--tests/async/twinasyncrw.nim2
3 files changed, 3 insertions, 9 deletions
diff --git a/tests/async/tasyncawait.nim b/tests/async/tasyncawait.nim
index 74933f063..e7a2ec1d9 100644
--- a/tests/async/tasyncawait.nim
+++ b/tests/async/tasyncawait.nim
@@ -41,10 +41,7 @@ proc createServer(port: Port) {.async.} =
   var server = newAsyncNativeSocket()
   block:
     var name: Sockaddr_in
-    when defined(windows):
-      name.sin_family = toInt(AF_INET).int16
-    else:
-      name.sin_family = toInt(AF_INET)
+    name.sin_family = toInt(AF_INET).uint16
     name.sin_port = htons(uint16(port))
     name.sin_addr.s_addr = htonl(INADDR_ANY)
     if bindAddr(server.SocketHandle, cast[ptr SockAddr](addr(name)),
diff --git a/tests/async/tnewasyncudp.nim b/tests/async/tnewasyncudp.nim
index e61f630e4..b442c0524 100644
--- a/tests/async/tnewasyncudp.nim
+++ b/tests/async/tnewasyncudp.nim
@@ -29,10 +29,7 @@ proc saveReceivedPort(port: int) =
 
 proc prepareAddress(intaddr: uint32, intport: uint16): ptr Sockaddr_in =
   result = cast[ptr Sockaddr_in](alloc0(sizeof(Sockaddr_in)))
-  when defined(windows):
-    result.sin_family = toInt(nativesockets.AF_INET).int16
-  else:
-    result.sin_family = toInt(nativesockets.AF_INET)
+  result.sin_family = toInt(nativesockets.AF_INET).uint16
   result.sin_port = nativesockets.htons(intport)
   result.sin_addr.s_addr = nativesockets.htonl(intaddr)
 
diff --git a/tests/async/twinasyncrw.nim b/tests/async/twinasyncrw.nim
index 42a7e3058..94193e921 100644
--- a/tests/async/twinasyncrw.nim
+++ b/tests/async/twinasyncrw.nim
@@ -234,7 +234,7 @@ when defined(windows):
     setBlocking(server, false)
     block:
       var name = Sockaddr_in()
-      name.sin_family = toInt(Domain.AF_INET).int16
+      name.sin_family = toInt(Domain.AF_INET).uint16
       name.sin_port = htons(uint16(port))
       name.sin_addr.s_addr = htonl(INADDR_ANY)
       if bindAddr(server, cast[ptr SockAddr](addr(name)),