]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-auth: checking return values of net_addr2ip in unit-test
authorMarkus Valentin <markus.valentin@open-xchange.com>
Thu, 20 Jun 2019 08:52:44 +0000 (10:52 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 10 Sep 2019 07:01:43 +0000 (10:01 +0300)
src/lib-auth/test-auth-master.c

index 93ff41751f2886f96bd14912a15a6fb77f2b8cc1..95c9dafe712415257914defe0a17dc14cb1f3bee 100644 (file)
@@ -18,10 +18,10 @@ static void test_auth_user_info_export(void)
        /* Setup info for auth_user_info_export call where the
         * resulting auth request string should contain all
         * real_ variables. */
-       net_addr2ip("192.168.1.1", &info.local_ip);
-       net_addr2ip("192.23.42.9", &info.real_local_ip);
-       net_addr2ip("10.42.3.223", &info.remote_ip);
-       net_addr2ip("192.168.1.2", &info.real_remote_ip);
+       test_assert(net_addr2ip("192.168.1.1", &info.local_ip) == 0);
+       test_assert(net_addr2ip("192.23.42.9", &info.real_local_ip) == 0);
+       test_assert(net_addr2ip("10.42.3.223", &info.remote_ip) == 0);
+       test_assert(net_addr2ip("192.168.1.2", &info.real_remote_ip) == 0);
        info.local_port = 57035;
        info.remote_port = 53075;
        info.real_remote_port = 64385;
@@ -42,8 +42,8 @@ static void test_auth_user_info_export(void)
        /* Setup info for auth_user_info_export call where the
         * resulting auth request string should not contain any
         * real_ variables. */
-       net_addr2ip("10.42.3.223", &info.real_remote_ip);
-       net_addr2ip("192.168.1.1", &info.real_local_ip);
+       test_assert(net_addr2ip("10.42.3.223", &info.real_remote_ip) == 0);
+       test_assert(net_addr2ip("192.168.1.1", &info.real_local_ip) == 0);
        info.real_remote_port = 53075;
        info.real_local_port = 57035;