summaryrefslogtreecommitdiffstats
path: root/tests/unittests
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-02-13 11:21:35 +0100
committerAndreas Schneider <asn@cryptomilk.org>2011-02-13 12:30:52 +0100
commit935e3b70aea8ee98a1dd5acb6589fd6842fb3380 (patch)
tree3dafa4449b379762b4fd6ba5cf7a82eb8203cd37 /tests/unittests
parent8d1bfb5a85d53114533f91a86cff19d70620a679 (diff)
downloadlibssh-935e3b70aea8ee98a1dd5acb6589fd6842fb3380.tar.gz
libssh-935e3b70aea8ee98a1dd5acb6589fd6842fb3380.tar.xz
libssh-935e3b70aea8ee98a1dd5acb6589fd6842fb3380.zip
misc: Added working ssh_is_ipaddr for Windows.
(cherry picked from commit cd30a1d4b1d47636f86579b666d769d395e19782)
Diffstat (limited to 'tests/unittests')
-rw-r--r--tests/unittests/torture_isipaddr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unittests/torture_isipaddr.c b/tests/unittests/torture_isipaddr.c
index fb034da9..1d2bab5a 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) {