]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-in-addr-util: add log headers
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 5 Sep 2020 14:55:10 +0000 (16:55 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 9 Sep 2020 22:46:44 +0000 (00:46 +0200)
src/test/test-in-addr-util.c
src/test/test-socket-util.c

index 63e9800ec8dbd092a43c72353765b178e62a1a3f..a9ecd0627bf6340715f3f0160b5a84e8ff9277af 100644 (file)
@@ -58,6 +58,8 @@ static void test_in_addr_prefix_from_string_one(
 }
 
 static void test_in_addr_prefix_from_string(void) {
+        log_info("/* %s */", __func__);
+
         test_in_addr_prefix_from_string_one("", AF_INET, -EINVAL, NULL, 0, -EINVAL, 0, -EINVAL, 0);
         test_in_addr_prefix_from_string_one("/", AF_INET, -EINVAL, NULL, 0, -EINVAL, 0, -EINVAL, 0);
         test_in_addr_prefix_from_string_one("/8", AF_INET, -EINVAL, NULL, 0, -EINVAL, 0, -EINVAL, 0);
@@ -90,7 +92,7 @@ static void test_in_addr_prefix_to_string_valid(int family, const char *p) {
         union in_addr_union u;
         unsigned char l;
 
-        log_info("/* %s */", p);
+        log_info("%s: %s", __func__, p);
 
         assert_se(in_addr_prefix_from_string(p, family, &u, &l) >= 0);
         assert_se(in_addr_prefix_to_string(family, &u, l, &str) >= 0);
@@ -102,7 +104,7 @@ static void test_in_addr_prefix_to_string_unoptimized(int family, const char *p)
         union in_addr_union u1, u2;
         unsigned char len1, len2;
 
-        log_info("/* %s */", p);
+        log_info("%s: %s", __func__, p);
 
         assert_se(in_addr_prefix_from_string(p, family, &u1, &len1) >= 0);
         assert_se(in_addr_prefix_to_string(family, &u1, len1, &str1) >= 0);
@@ -115,6 +117,8 @@ static void test_in_addr_prefix_to_string_unoptimized(int family, const char *p)
 }
 
 static void test_in_addr_prefix_to_string(void) {
+        log_info("/* %s */", __func__);
+
         test_in_addr_prefix_to_string_valid(AF_INET, "0.0.0.0/32");
         test_in_addr_prefix_to_string_valid(AF_INET, "1.2.3.4/0");
         test_in_addr_prefix_to_string_valid(AF_INET, "1.2.3.4/24");
@@ -137,6 +141,8 @@ static void test_in_addr_random_prefix(void) {
         _cleanup_free_ char *str = NULL;
         union in_addr_union a;
 
+        log_info("/* %s */", __func__);
+
         assert_se(in_addr_from_string(AF_INET, "192.168.10.1", &a) >= 0);
 
         assert_se(in_addr_random_prefix(AF_INET, &a, 31, 32) >= 0);
index 0bc713cb5320a4fe51fdbd9faa9911d2261b7a3f..d0dda3795129dcb59979aa11cad2304bfc98bfe8 100644 (file)
@@ -504,17 +504,11 @@ int main(int argc, char *argv[]) {
         test_setup_logging(LOG_DEBUG);
 
         test_ifname_valid();
-
         test_socket_print_unix();
-
         test_sockaddr_equal();
-
         test_sockaddr_un_len();
-
         test_in_addr_is_multicast();
-
         test_getpeercred_getpeergroups();
-
         test_passfd_read();
         test_passfd_contents_read();
         test_receive_nopassfd();