tnativesockets.nim 582 B

1234567891011121314151617181920212223242526
  1. import std/nativesockets
  2. import stdtest/testutils
  3. block:
  4. let hostname = getHostname()
  5. doAssert hostname.len > 0
  6. when defined(windows):
  7. assertAll:
  8. toInt(IPPROTO_IP) == 0
  9. toInt(IPPROTO_ICMP) == 1
  10. toInt(IPPROTO_TCP) == 6
  11. toInt(IPPROTO_UDP) == 17
  12. toInt(IPPROTO_IPV6) == 41
  13. toInt(IPPROTO_ICMPV6) == 58
  14. toInt(IPPROTO_RAW) == 20
  15. # no changes to enum value
  16. ord(IPPROTO_TCP) == 6
  17. ord(IPPROTO_UDP) == 17
  18. ord(IPPROTO_IP) == 18
  19. ord(IPPROTO_IPV6) == 19
  20. ord(IPPROTO_RAW) == 20
  21. ord(IPPROTO_ICMP) == 21
  22. ord(IPPROTO_ICMPV6) == 22