]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/test/test-log.c
log: Add LOG_SET_PREFIX() macro
[thirdparty/systemd.git] / src / test / test-log.c
index 4fc4bc90874e8c062b1cfc9a3aaaee8f065b857c..e337a3c7df397395f5be9630e463ebeb5405face 100644 (file)
@@ -175,6 +175,32 @@ static void test_log_context(void) {
         assert_se(log_context_num_fields() == 0);
 }
 
+static void test_log_prefix(void) {
+        {
+                LOG_SET_PREFIX("ABC");
+
+                test_log_struct();
+                test_long_lines();
+                test_log_syntax();
+
+                {
+                        LOG_SET_PREFIX("QED");
+
+                        test_log_struct();
+                        test_long_lines();
+                        test_log_syntax();
+                }
+
+                test_log_struct();
+                test_long_lines();
+                test_log_syntax();
+        }
+
+        test_log_struct();
+        test_long_lines();
+        test_log_syntax();
+}
+
 int main(int argc, char* argv[]) {
         test_file();
 
@@ -188,6 +214,7 @@ int main(int argc, char* argv[]) {
                 test_long_lines();
                 test_log_syntax();
                 test_log_context();
+                test_log_prefix();
         }
 
         return 0;