diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-02-12 19:14:30 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-02-12 19:16:06 +0100 |
commit | 5d4bd5a21d9b903341c175696b0c747076672572 (patch) | |
tree | e0de50da8dbfbde75e204cd24e57657e0e85eb3b /tests/unittests/torture_isipaddr.c | |
parent | e8c3f5575173f2d0f0258992574ea3d5352fcf43 (diff) | |
download | libssh-5d4bd5a21d9b903341c175696b0c747076672572.tar.gz libssh-5d4bd5a21d9b903341c175696b0c747076672572.tar.xz libssh-5d4bd5a21d9b903341c175696b0c747076672572.zip |
tests: Added ipv6 tests.
Diffstat (limited to 'tests/unittests/torture_isipaddr.c')
-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 83cf161d..f1cd6b7a 100644 --- a/tests/unittests/torture_isipaddr.c +++ b/tests/unittests/torture_isipaddr.c @@ -9,6 +9,7 @@ */ static void torture_ssh_is_ipaddr(void **state) { (void)state; + assert_int_equal(ssh_is_ipaddr("127.0.0.1"),1); assert_int_equal(ssh_is_ipaddr("0.0.0.0"),1); assert_int_equal(ssh_is_ipaddr("1.1.1.1"),1); @@ -17,6 +18,13 @@ static void torture_ssh_is_ipaddr(void **state) { assert_int_equal(ssh_is_ipaddr("1.10.100.1"),1); assert_int_equal(ssh_is_ipaddr("0.1.10.100"),1); + assert_int_equal(ssh_is_ipaddr("2001:0db8:85a3:0000:0000:8a2e:0370:7334"),1); + 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("::ffff:192.0.2.128"),1); + assert_int_equal(ssh_is_ipaddr("0.0.0.0.0"),0); assert_int_equal(ssh_is_ipaddr("0.0.0.0.a"),0); assert_int_equal(ssh_is_ipaddr("a.0.0.0"),0); |