Improved test for #6.
This commit is contained in:
parent
9fb0eb8f36
commit
44565b398e
|
@ -20,7 +20,12 @@ type
|
||||||
proc udp4DataAvailable(transp: DatagramTransport,
|
proc udp4DataAvailable(transp: DatagramTransport,
|
||||||
remote: TransportAddress): Future[void] {.async, gcsafe.} =
|
remote: TransportAddress): Future[void] {.async, gcsafe.} =
|
||||||
var udata = getUserData[CustomData](transp)
|
var udata = getUserData[CustomData](transp)
|
||||||
if udata.test == "CHECK":
|
var expect = TEST_MSG
|
||||||
|
var data: seq[byte]
|
||||||
|
var datalen: int
|
||||||
|
transp.peekMessage(data, datalen)
|
||||||
|
if udata.test == "CHECK" and datalen == MSG_LEN and
|
||||||
|
equalMem(addr data[0], addr expect[0], datalen):
|
||||||
udata.test = "OK"
|
udata.test = "OK"
|
||||||
transp.close()
|
transp.close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue