mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
new tests for ipOps.fromdword and todword
This commit is contained in:
parent
3140dbe115
commit
090b522c06
1 changed files with 2 additions and 0 deletions
|
|
@ -683,7 +683,9 @@ test_suite = unittest.TestSuite:new()
|
|||
test_suite:add_test(unittest.is_true(isPrivate("192.168.123.123")), "192.168.123.123 is private")
|
||||
test_suite:add_test(unittest.is_false(isPrivate("1.1.1.1")), "1.1.1.1 is not private")
|
||||
test_suite:add_test(unittest.equal(todword("65.66.67.68"),0x41424344), "todword")
|
||||
test_suite:add_test(unittest.equal(todword("127.0.0.1"),0x7f000001), "todword")
|
||||
test_suite:add_test(unittest.equal(fromdword(0xffffffff),"255.255.255.255"), "fromdword")
|
||||
test_suite:add_test(unittest.equal(fromdword(0x7f000001),"127.0.0.1"), "fromdword")
|
||||
test_suite:add_test(unittest.equal(str_to_ip("\x01\x02\x03\x04"),"1.2.3.4"), "str_to_ip (ipv4)")
|
||||
test_suite:add_test(unittest.equal(str_to_ip("\0\x01\xbe\xef\0\0\0\0\0\0\x02\x03\0\0\0\x01"),"1:beef::203:0:1"), "str_to_ip (ipv6)")
|
||||
test_suite:add_test(unittest.equal(str_to_ip(("\0"):rep(15) .. "\x01"),"::1"), "str_to_ip (ipv6)")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue