Browse code
additional openlog test coverage
Greg Wiley authored on 05/04/2017 22:31:14
Showing 2 changed files
Showing 2 changed files
... | ... |
@@ -13,9 +13,11 @@ void dc_closelog(void) { |
13 | 13 |
|
14 | 14 |
int opened_facility = -1000; |
15 | 15 |
const char *opened_program_name = ""; |
16 |
+int opened_logopt = -1000; |
|
16 | 17 |
void dc_openlog(const char *ident, int logopt, int facility) { |
17 | 18 |
opened_facility = facility; |
18 | 19 |
opened_program_name = ident; |
20 |
+ opened_logopt = logopt; |
|
19 | 21 |
} |
20 | 22 |
|
21 | 23 |
|
... | ... |
@@ -31,6 +33,7 @@ int test_log_success() { |
31 | 33 |
// given |
32 | 34 |
opened_facility = -1000; |
33 | 35 |
opened_program_name = ""; |
36 |
+ opened_logopt = -1000; |
|
34 | 37 |
|
35 | 38 |
// when |
36 | 39 |
log_success(); |
... | ... |
@@ -38,6 +41,7 @@ int test_log_success() { |
38 | 41 |
// then |
39 | 42 |
check(opened_facility == LOG_AUTHPRIV, "facility should be authpriv"); |
40 | 43 |
check(!strcmp(opened_program_name, "pam_dual_control"), "incorrect program name"); |
44 |
+ check(opened_logopt == 0, "incorrect log option"); |
|
41 | 45 |
|
42 | 46 |
succeed(); |
43 | 47 |
} |