diff options
| author | Andreas Schneider <asn@cryptomilk.org> | 2011-02-13 17:36:45 +0100 |
|---|---|---|
| committer | Andreas Schneider <asn@cryptomilk.org> | 2011-02-13 17:39:18 +0100 |
| commit | 4f65104ecccdc2d1bb9665760efc5e5b388d1b5d (patch) | |
| tree | 37e39cd28e1ffc0d17ba9f373f804165e22cc06f /tests | |
| parent | 242e1c342ca016f2de23261e2b7aff3d9549e325 (diff) | |
| download | libssh-4f65104ecccdc2d1bb9665760efc5e5b388d1b5d.tar.gz libssh-4f65104ecccdc2d1bb9665760efc5e5b388d1b5d.tar.xz libssh-4f65104ecccdc2d1bb9665760efc5e5b388d1b5d.zip | |
misc: Fixed ssh_is_ipaddr_v4() on Windows.
(cherry picked from commit eea1df3574db36036aa68c098bc29996a241808d)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unittests/torture_isipaddr.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/unittests/torture_isipaddr.c b/tests/unittests/torture_isipaddr.c index 1d2bab5a..eacc06ef 100644 --- a/tests/unittests/torture_isipaddr.c +++ b/tests/unittests/torture_isipaddr.c @@ -23,6 +23,7 @@ static void torture_ssh_is_ipaddr(void **state) { assert_int_equal(ssh_is_ipaddr("fe80:0000:0000:0000:0202:b3ff:fe1e:8329"),1); assert_int_equal(ssh_is_ipaddr("fe80:0:0:0:202:b3ff:fe1e:8329"),1); assert_int_equal(ssh_is_ipaddr("fe80::202:b3ff:fe1e:8329"),1); + assert_int_equal(ssh_is_ipaddr("::1"),1); assert_int_equal(ssh_is_ipaddr("::ffff:192.0.2.128"),1); @@ -32,15 +33,13 @@ static void torture_ssh_is_ipaddr(void **state) { assert_int_equal(ssh_is_ipaddr("0a.0.0.0.0"),0); assert_int_equal(ssh_is_ipaddr(""),0); assert_int_equal(ssh_is_ipaddr("0.0.0."),0); -#ifndef _WIN32 - /* These are valid ip address on Windows */ - assert_int_equal(ssh_is_ipaddr("0.0.0"),0); assert_int_equal(ssh_is_ipaddr("0.0"),0); assert_int_equal(ssh_is_ipaddr("0"),0); -#endif assert_int_equal(ssh_is_ipaddr("2001:0db8:85a3:0000:0000:8a2e:0370:7334:1002"), 0); assert_int_equal(ssh_is_ipaddr("fe80:x:202:b3ff:fe1e:8329"), 0); + assert_int_equal(ssh_is_ipaddr("fe80:x:202:b3ff:fe1e:8329"), 0); + assert_int_equal(ssh_is_ipaddr(":1"), 0); } int torture_run_tests(void) { |
