git.fiddlerwoaroof.com
Browse code

syslog test coverage

Greg Wiley authored on 05/04/2017 22:34:15
Showing 2 changed files
1 1
Binary files a/logging_test and b/logging_test differ
... ...
@@ -4,8 +4,9 @@
4 4
 #include "dc_syslog.h"
5 5
 #include "logging.h"
6 6
 
7
-
7
+int test_priority = -1000;
8 8
 void dc_syslog(int priority, const char *message, ...) {
9
+    test_priority = priority;
9 10
 }
10 11
 
11 12
 void dc_closelog(void) {
... ...
@@ -34,6 +35,7 @@ int test_log_success() {
34 35
     opened_facility = -1000;
35 36
     opened_program_name = "";
36 37
     opened_logopt = -1000;
38
+    test_priority = -1000;
37 39
 
38 40
     // when
39 41
     log_success();
... ...
@@ -42,6 +44,7 @@ int test_log_success() {
42 44
     check(opened_facility == LOG_AUTHPRIV, "facility should be authpriv");
43 45
     check(!strcmp(opened_program_name, "pam_dual_control"), "incorrect program name");
44 46
     check(opened_logopt == 0, "incorrect log option");
47
+    check(test_priority == LOG_NOTICE, "incorrect priority");
45 48
 
46 49
     succeed();
47 50
 }