mirror of
https://github.com/status-im/nim-chronos.git
synced 2025-01-21 08:49:45 +00:00
Fix some compilation warnings.
This commit is contained in:
parent
5758d07c08
commit
29d9274e03
@ -362,13 +362,13 @@ when defined(windows) or defined(nimdoc):
|
||||
## Creates a new Dispatcher instance.
|
||||
new result
|
||||
result.ioPort = createIoCompletionPort(INVALID_HANDLE_VALUE, 0, 0, 1)
|
||||
when compiles(initHashSet):
|
||||
when declared(initHashSet):
|
||||
# After 0.20.0 Nim's stdlib version
|
||||
result.handles = initHashSet[AsyncFD]()
|
||||
else:
|
||||
# Pre 0.20.0 Nim's stdlib version
|
||||
result.handles = initSet[AsyncFD]()
|
||||
when compiles(initHeapQueue):
|
||||
when declared(initHeapQueue):
|
||||
# After 0.20.0 Nim's stdlib version
|
||||
result.timers = initHeapQueue[TimerCallback]()
|
||||
else:
|
||||
@ -510,7 +510,12 @@ elif unixPlatform:
|
||||
## Create new dispatcher.
|
||||
new result
|
||||
result.selector = newSelector[SelectorData]()
|
||||
result.timers.newHeapQueue()
|
||||
when declared(initHeapQueue):
|
||||
# After 0.20.0 Nim's stdlib version
|
||||
result.timers = initHeapQueue()
|
||||
else:
|
||||
# Before 0.20.0 Nim's stdlib version
|
||||
result.timers.newHeapQueue()
|
||||
result.callbacks = initDeque[AsyncCallback](64)
|
||||
result.keys = newSeq[ReadyKey](64)
|
||||
result.trackers = initTable[string, TrackerBase]()
|
||||
|
@ -8,6 +8,8 @@
|
||||
import strutils, unittest
|
||||
import ../chronos
|
||||
|
||||
when defined(nimHasUsed): {.used.}
|
||||
|
||||
suite "TransportAddress test suite":
|
||||
test "initTAddress(string)":
|
||||
check $initTAddress("0.0.0.0:1") == "0.0.0.0:1"
|
||||
|
@ -8,6 +8,8 @@
|
||||
import strutils, unittest, os
|
||||
import ../chronos, ../chronos/streams/tlsstream
|
||||
|
||||
when defined(nimHasUsed): {.used.}
|
||||
|
||||
const SelfSignedRsaKey = """
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDSXcKMR6zIIHSy
|
||||
|
@ -8,6 +8,8 @@
|
||||
import unittest
|
||||
import ../chronos
|
||||
|
||||
when defined(nimHasUsed): {.used.}
|
||||
|
||||
suite "Asynchronous issues test suite":
|
||||
const HELLO_PORT = 45679
|
||||
const TEST_MSG = "testmsg"
|
||||
|
@ -8,6 +8,8 @@
|
||||
import strutils, net, unittest
|
||||
import ../chronos
|
||||
|
||||
when defined(nimHasUsed): {.used.}
|
||||
|
||||
suite "Datagram Transport test suite":
|
||||
const
|
||||
TestsCount = 2000
|
||||
|
@ -8,6 +8,8 @@
|
||||
import unittest
|
||||
import ../chronos
|
||||
|
||||
when defined(nimHasUsed): {.used.}
|
||||
|
||||
suite "Future[T] behavior test suite":
|
||||
proc testFuture1(): Future[int] {.async.} =
|
||||
await sleepAsync(0.milliseconds)
|
||||
|
@ -8,6 +8,8 @@
|
||||
import unittest
|
||||
import ../chronos
|
||||
|
||||
when defined(nimHasUsed): {.used.}
|
||||
|
||||
proc asyncRetValue(n: int): Future[int] {.async.} =
|
||||
await sleepAsync(n.milliseconds)
|
||||
result = n * 10
|
||||
|
@ -8,6 +8,8 @@
|
||||
import unittest
|
||||
import ../chronos
|
||||
|
||||
when defined(nimHasUsed): {.used.}
|
||||
|
||||
suite "Network utilities test suite":
|
||||
|
||||
const MaskVectors = [
|
||||
|
@ -8,6 +8,8 @@
|
||||
import strutils, unittest
|
||||
import ../chronos
|
||||
|
||||
when defined(nimHasUsed): {.used.}
|
||||
|
||||
suite "Server's test suite":
|
||||
type
|
||||
CustomServer = ref object of StreamServer
|
||||
|
@ -8,6 +8,8 @@
|
||||
import unittest, strutils
|
||||
import ../chronos
|
||||
|
||||
when defined(nimHasUsed): {.used.}
|
||||
|
||||
when not defined(windows):
|
||||
import posix
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
||||
import unittest
|
||||
import ../chronos
|
||||
|
||||
when defined(nimHasUsed): {.used.}
|
||||
|
||||
suite "callSoon() tests suite":
|
||||
const CallSoonTests = 10
|
||||
var soonTest1 = 0'u
|
||||
|
@ -8,6 +8,8 @@
|
||||
import strutils, unittest, os
|
||||
import ../chronos
|
||||
|
||||
when defined(nimHasUsed): {.used.}
|
||||
|
||||
when defined(windows):
|
||||
import winlean
|
||||
else:
|
||||
|
@ -8,6 +8,8 @@
|
||||
import unittest
|
||||
import ../chronos
|
||||
|
||||
when defined(nimHasUsed): {.used.}
|
||||
|
||||
suite "Asynchronous sync primitives test suite":
|
||||
var testLockResult = ""
|
||||
var testEventResult = ""
|
||||
|
@ -8,6 +8,8 @@
|
||||
import os, unittest
|
||||
import ../chronos, ../chronos/timer
|
||||
|
||||
when defined(nimHasUsed): {.used.}
|
||||
|
||||
suite "Asynchronous timers test suite":
|
||||
const TimersCount = 10
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user