diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-02-13 11:21:35 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-02-13 11:56:47 +0100 |
commit | cd30a1d4b1d47636f86579b666d769d395e19782 (patch) | |
tree | 282193d4d7897f9b7e46dc22154e2d0944c1e143 /tests/unittests | |
parent | ca941d6985a41498744b4c1549c7aa05dbd8d10c (diff) | |
download | libssh-cd30a1d4b1d47636f86579b666d769d395e19782.tar.gz libssh-cd30a1d4b1d47636f86579b666d769d395e19782.tar.xz libssh-cd30a1d4b1d47636f86579b666d769d395e19782.zip |
misc: Added working ssh_is_ipaddr for Windows.
Diffstat (limited to 'tests/unittests')
-rw-r--r-- | tests/unittests/torture_isipaddr.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unittests/torture_isipaddr.c b/tests/unittests/torture_isipaddr.c index fb034da..1d2bab5 100644 --- a/tests/unittests/torture_isipaddr.c +++ b/tests/unittests/torture_isipaddr.c @@ -32,7 +32,15 @@ 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); } int torture_run_tests(void) { |