aboutsummaryrefslogtreecommitdiff
path: root/tests/util/messages-t.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/util/messages-t.c')
-rw-r--r--tests/util/messages-t.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/util/messages-t.c b/tests/util/messages-t.c
index e8a7835..cfb661a 100644
--- a/tests/util/messages-t.c
+++ b/tests/util/messages-t.c
@@ -5,7 +5,7 @@
* which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle@eyrie.org>
- * Copyright 2002, 2004-2005, 2015, 2017 Russ Allbery <eagle@eyrie.org>
+ * Copyright 2002, 2004-2005, 2015, 2017, 2020 Russ Allbery <eagle@eyrie.org>
* Copyright 2009-2012
* The Board of Trustees of the Leland Stanford Junior University
*
@@ -54,7 +54,7 @@ test1(void *data UNUSED)
warn("warning");
}
-static void __attribute__((__noreturn__))
+__attribute__((__noreturn__)) static void
test2(void *data UNUSED)
{
die("fatal");
@@ -67,7 +67,7 @@ test3(void *data UNUSED)
syswarn("permissions");
}
-static void __attribute__((__noreturn__))
+__attribute__((__noreturn__)) static void
test4(void *data UNUSED)
{
errno = EACCES;
@@ -81,7 +81,7 @@ test5(void *data UNUSED)
warn("warning");
}
-static void __attribute__((__noreturn__))
+__attribute__((__noreturn__)) static void
test6(void *data UNUSED)
{
message_program_name = "test6";
@@ -96,7 +96,7 @@ test7(void *data UNUSED)
syswarn("perms %d", 7);
}
-static void __attribute__((__noreturn__))
+__attribute__((__noreturn__)) static void
test8(void *data UNUSED)
{
message_program_name = "test8";
@@ -110,14 +110,14 @@ return10(void)
return 10;
}
-static void __attribute__((__noreturn__))
+__attribute__((__noreturn__)) static void
test9(void *data UNUSED)
{
message_fatal_cleanup = return10;
die("fatal");
}
-static void __attribute__((__noreturn__))
+__attribute__((__noreturn__)) static void
test10(void *data UNUSED)
{
message_program_name = 0;
@@ -126,7 +126,7 @@ test10(void *data UNUSED)
sysdie("fatal perm");
}
-static void __attribute__((__noreturn__))
+__attribute__((__noreturn__)) static void
test11(void *data UNUSED)
{
message_program_name = "test11";
@@ -136,7 +136,7 @@ test11(void *data UNUSED)
sysdie("fatal");
}
-static void __attribute__((__format__(printf, 2, 0)))
+__attribute__((__format__(printf, 2, 0))) static void
log_msg(size_t len, const char *format, va_list args, int error)
{
fprintf(stderr, "%lu %d ", (unsigned long) len, error);
@@ -151,7 +151,7 @@ test12(void *data UNUSED)
warn("warning");
}
-static void __attribute__((__noreturn__))
+__attribute__((__noreturn__)) static void
test13(void *data UNUSED)
{
message_handlers_die(1, log_msg);
@@ -166,7 +166,7 @@ test14(void *data UNUSED)
syswarn("warning");
}
-static void __attribute__((__noreturn__))
+__attribute__((__noreturn__)) static void
test15(void *data UNUSED)
{
message_handlers_die(2, log_msg, log_msg);
@@ -218,22 +218,22 @@ test21(void *data UNUSED)
debug("baz");
}
-static void __attribute__((__noreturn__))
+__attribute__((__noreturn__)) static void
test22(void *data UNUSED)
{
message_handlers_die(0);
die("hi mom!");
}
-static
-void test23(void *data UNUSED)
+static void
+test23(void *data UNUSED)
{
message_handlers_warn(0);
warn("this is a test");
}
-static
-void test24(void *data UNUSED)
+static void
+test24(void *data UNUSED)
{
notice("first");
message_handlers_notice(0);
@@ -305,7 +305,7 @@ main(void)
is_function_output(test20, NULL, 0, "3 0 foo\n", "test20");
is_function_output(test21, NULL, 0, "test23: baz\n", "test21");
- /* Make sure that it's possible to turn off a message type entirely. */
+ /* Make sure that it's possible to turn off a message type entirely. */
is_function_output(test22, NULL, 1, "", "test22");
is_function_output(test23, NULL, 0, "", "test23");
is_function_output(test24, NULL, 0, "first\nthird\n", "test24");