Browse code
change syslog message
Showing 3 changed files
... | ... |
@@ -5,8 +5,10 @@ |
5 | 5 |
#include "logging.h" |
6 | 6 |
|
7 | 7 |
int test_priority = -1000; |
8 |
+const char *logged_message = ""; |
|
8 | 9 |
void dc_syslog(int priority, const char *message, ...) { |
9 | 10 |
test_priority = priority; |
11 |
+ logged_message = message; |
|
10 | 12 |
} |
11 | 13 |
|
12 | 14 |
void dc_closelog(void) { |
... | ... |
@@ -36,6 +38,7 @@ int test_log_success() { |
36 | 38 |
opened_program_name = ""; |
37 | 39 |
opened_logopt = -1000; |
38 | 40 |
test_priority = -1000; |
41 |
+ logged_message = ""; |
|
39 | 42 |
|
40 | 43 |
// when |
41 | 44 |
log_success(); |
... | ... |
@@ -45,6 +48,7 @@ int test_log_success() { |
45 | 48 |
check(!strcmp(opened_program_name, "pam_dual_control"), "incorrect program name"); |
46 | 49 |
check(opened_logopt == 0, "incorrect log option"); |
47 | 50 |
check(test_priority == LOG_NOTICE, "incorrect priority"); |
51 |
+ check(!strcmp(logged_message, "dual control succeeded"), "incorrect logged message"); |
|
48 | 52 |
|
49 | 53 |
succeed(); |
50 | 54 |
} |