OLD | NEW |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 /* | 4 /* |
5 * test_logger.c | 5 * test_logger.c |
6 * | 6 * |
7 * Tests Logger Objects | 7 * Tests Logger Objects |
8 * | 8 * |
9 */ | 9 */ |
10 | 10 |
11 #include "testutil.h" | 11 #include "testutil.h" |
12 #include "testutil_nss.h" | 12 #include "testutil_nss.h" |
13 | 13 |
14 static void *plContext = NULL; | 14 static void *plContext = NULL; |
15 | 15 |
16 static char *levels[] = { | 16 static char *levels[] = {"None", "Fatal Error", "Error", |
17 "None", | 17 "Warning", "Debug", "Trace"}; |
18 "Fatal Error", | 18 |
19 "Error", | 19 static PKIX_Error *testLoggerCallback(PKIX_Logger *logger, |
20 "Warning", | 20 PKIX_PL_String *message, |
21 "Debug", | 21 PKIX_UInt32 logLevel, |
22 "Trace" | 22 PKIX_ERRORCLASS logComponent, |
23 }; | 23 void *plContext) { |
24 | 24 char *comp = NULL; |
25 static | 25 char *msg = NULL; |
26 PKIX_Error *testLoggerCallback( | 26 char result[100]; |
27 PKIX_Logger *logger, | 27 static int callCount = 0; |
28 PKIX_PL_String *message, | 28 |
29 PKIX_UInt32 logLevel, | 29 PKIX_TEST_STD_VARS(); |
30 PKIX_ERRORCLASS logComponent, | 30 |
31 void *plContext) | 31 msg = PKIX_String2ASCII(message, plContext); |
32 { | 32 PR_snprintf(result, 100, "Logging %s (%s): %s", levels[logLevel], |
33 char *comp = NULL; | 33 PKIX_ERRORCLASSNAMES[logComponent], msg); |
34 char *msg = NULL; | 34 subTest(result); |
35 char result[100]; | 35 |
36 static int callCount = 0; | 36 callCount++; |
37 | 37 if (callCount > 1) { |
38 PKIX_TEST_STD_VARS(); | 38 testError("Incorrect number of Logger Callback <expect 1>"); |
39 | 39 } |
40 msg = PKIX_String2ASCII(message, plContext); | 40 |
41 PR_snprintf(result, 100, "Logging %s (%s): %s", | 41 cleanup: |
42 levels[logLevel], PKIX_ERRORCLASSNAMES[logComponent], msg); | 42 |
43 subTest(result); | 43 PKIX_TEST_EXPECT_NO_ERROR(PKIX_PL_Free(msg, plContext)); |
44 | 44 PKIX_TEST_RETURN(); |
45 callCount++; | 45 } |
46 if (callCount > 1) { | 46 |
47 testError("Incorrect number of Logger Callback <expect 1>"); | 47 static PKIX_Error *testLoggerCallback2(PKIX_Logger *logger, |
48 } | 48 PKIX_PL_String *message, |
49 | 49 PKIX_UInt32 logLevel, |
50 cleanup: | 50 PKIX_ERRORCLASS logComponent, |
51 | 51 void *plContext) { |
52 PKIX_TEST_EXPECT_NO_ERROR(PKIX_PL_Free(msg, plContext)); | 52 char *comp = NULL; |
53 PKIX_TEST_RETURN(); | 53 char *msg = NULL; |
54 } | 54 char result[100]; |
55 | 55 |
56 static | 56 PKIX_TEST_STD_VARS(); |
57 PKIX_Error *testLoggerCallback2( | 57 |
58 PKIX_Logger *logger, | 58 msg = PKIX_String2ASCII(message, plContext); |
59 PKIX_PL_String *message, | 59 PR_snprintf(result, 100, "Logging %s (%s): %s", levels[logLevel], |
60 PKIX_UInt32 logLevel, | 60 PKIX_ERRORCLASSNAMES[logComponent], msg); |
61 PKIX_ERRORCLASS logComponent, | 61 subTest(result); |
62 void *plContext) | 62 |
63 { | 63 cleanup: |
64 char *comp = NULL; | 64 PKIX_TEST_EXPECT_NO_ERROR(PKIX_PL_Free(msg, plContext)); |
65 char *msg = NULL; | 65 PKIX_TEST_RETURN(); |
66 char result[100]; | 66 } |
67 | 67 |
68 PKIX_TEST_STD_VARS(); | 68 static void createLogger(PKIX_Logger **logger, PKIX_PL_Object *context, |
69 | 69 PKIX_Logger_LogCallback cb) { |
70 msg = PKIX_String2ASCII(message, plContext); | 70 PKIX_TEST_STD_VARS(); |
71 PR_snprintf(result, 100, "Logging %s (%s): %s", | 71 |
72 levels[logLevel], PKIX_ERRORCLASSNAMES[logComponent], msg); | 72 PKIX_TEST_EXPECT_NO_ERROR(PKIX_Logger_Create(cb, context, logger, plContext)); |
73 subTest(result); | 73 |
74 | 74 cleanup: |
75 cleanup: | 75 |
76 PKIX_TEST_EXPECT_NO_ERROR(PKIX_PL_Free(msg, plContext)); | 76 PKIX_TEST_RETURN(); |
77 PKIX_TEST_RETURN(); | 77 } |
78 } | 78 |
79 | 79 static void testContextCallback(PKIX_Logger *logger, PKIX_Logger *logger2) { |
80 static void | 80 PKIX_Logger_LogCallback cb = NULL; |
81 createLogger(PKIX_Logger **logger, | 81 PKIX_PL_Object *context = NULL; |
82 PKIX_PL_Object *context, | 82 PKIX_Boolean cmpResult = PKIX_FALSE; |
83 PKIX_Logger_LogCallback cb) | 83 PKIX_UInt32 length; |
84 { | 84 |
85 PKIX_TEST_STD_VARS(); | 85 PKIX_TEST_STD_VARS(); |
86 | 86 |
87 PKIX_TEST_EXPECT_NO_ERROR(PKIX_Logger_Create | 87 subTest("PKIX_Logger_GetLoggerContext"); |
88 (cb, context, logger, plContext)); | 88 PKIX_TEST_EXPECT_NO_ERROR( |
89 | 89 PKIX_Logger_GetLoggerContext(logger2, &context, plContext)); |
90 cleanup: | 90 |
91 | 91 testEqualsHelper((PKIX_PL_Object *)logger, context, PKIX_TRUE, plContext); |
92 PKIX_TEST_RETURN(); | 92 |
93 } | 93 subTest("PKIX_Logger_GetLogCallback"); |
94 | 94 PKIX_TEST_EXPECT_NO_ERROR(PKIX_Logger_GetLogCallback(logger, &cb, plContext)); |
95 static void | 95 |
96 testContextCallback(PKIX_Logger *logger, PKIX_Logger *logger2) | 96 if (cb != testLoggerCallback) { |
97 { | 97 testError("Incorrect Logger Callback returned"); |
98 PKIX_Logger_LogCallback cb = NULL; | 98 } |
99 PKIX_PL_Object *context = NULL; | 99 |
100 PKIX_Boolean cmpResult = PKIX_FALSE; | 100 cleanup: |
101 PKIX_UInt32 length; | 101 |
102 | 102 PKIX_TEST_DECREF_AC(context); |
103 PKIX_TEST_STD_VARS(); | 103 PKIX_TEST_RETURN(); |
104 | 104 } |
105 subTest("PKIX_Logger_GetLoggerContext"); | 105 |
106 PKIX_TEST_EXPECT_NO_ERROR(PKIX_Logger_GetLoggerContext | 106 static void testComponent(PKIX_Logger *logger) { |
107 (logger2, &context, plContext)); | 107 PKIX_ERRORCLASS compName = (PKIX_ERRORCLASS)NULL; |
108 | 108 PKIX_ERRORCLASS compNameReturn = (PKIX_ERRORCLASS)NULL; |
109 testEqualsHelper | 109 PKIX_Boolean cmpResult = PKIX_FALSE; |
110 ((PKIX_PL_Object *)logger, context, PKIX_TRUE, plContext); | 110 PKIX_TEST_STD_VARS(); |
111 | 111 |
112 subTest("PKIX_Logger_GetLogCallback"); | 112 subTest("PKIX_Logger_GetLoggingComponent"); |
113 PKIX_TEST_EXPECT_NO_ERROR(PKIX_Logger_GetLogCallback | 113 PKIX_TEST_EXPECT_NO_ERROR( |
114 (logger, &cb, plContext)); | 114 PKIX_Logger_GetLoggingComponent(logger, &compName, plContext)); |
115 | 115 |
116 if (cb != testLoggerCallback) { | 116 if (compName != (PKIX_ERRORCLASS)NULL) { |
117 testError("Incorrect Logger Callback returned"); | 117 testError("Incorrect Logger Component returned. expect <NULL>"); |
118 } | 118 } |
119 | 119 |
120 cleanup: | 120 subTest("PKIX_Logger_SetLoggingComponent"); |
121 | 121 PKIX_TEST_EXPECT_NO_ERROR( |
122 PKIX_TEST_DECREF_AC(context); | 122 PKIX_Logger_SetLoggingComponent(logger, PKIX_LIST_ERROR, plContext)); |
123 PKIX_TEST_RETURN(); | 123 |
124 } | 124 subTest("PKIX_Logger_GetLoggingComponent"); |
125 | 125 PKIX_TEST_EXPECT_NO_ERROR( |
126 static void | 126 PKIX_Logger_GetLoggingComponent(logger, &compNameReturn, plContext)); |
127 testComponent(PKIX_Logger *logger) | 127 |
128 { | 128 if (compNameReturn != PKIX_LIST_ERROR) { |
129 PKIX_ERRORCLASS compName = (PKIX_ERRORCLASS)NULL; | 129 testError("Incorrect Logger Component returned."); |
130 PKIX_ERRORCLASS compNameReturn = (PKIX_ERRORCLASS)NULL; | 130 } |
131 PKIX_Boolean cmpResult = PKIX_FALSE; | 131 |
132 PKIX_TEST_STD_VARS(); | 132 cleanup: |
133 | 133 |
134 subTest("PKIX_Logger_GetLoggingComponent"); | 134 PKIX_TEST_RETURN(); |
135 PKIX_TEST_EXPECT_NO_ERROR(PKIX_Logger_GetLoggingComponent | 135 } |
136 (logger, &compName, plContext)); | 136 |
137 | 137 static void testMaxLoggingLevel(PKIX_Logger *logger) { |
138 if (compName != (PKIX_ERRORCLASS)NULL) { | 138 PKIX_UInt32 level = 0; |
139 testError("Incorrect Logger Component returned. expect <NULL>"); | 139 PKIX_TEST_STD_VARS(); |
140 } | 140 |
141 | 141 subTest("PKIX_Logger_GetMaxLoggingLevel"); |
142 subTest("PKIX_Logger_SetLoggingComponent"); | 142 PKIX_TEST_EXPECT_NO_ERROR( |
143 PKIX_TEST_EXPECT_NO_ERROR(PKIX_Logger_SetLoggingComponent | 143 PKIX_Logger_GetMaxLoggingLevel(logger, &level, plContext)); |
144 (logger, PKIX_LIST_ERROR, plContext)); | 144 |
145 | 145 if (level != 0) { |
146 subTest("PKIX_Logger_GetLoggingComponent"); | 146 testError("Incorrect Logger MaxLoggingLevel returned"); |
147 PKIX_TEST_EXPECT_NO_ERROR(PKIX_Logger_GetLoggingComponent | 147 } |
148 (logger, &compNameReturn, plContext)); | 148 |
149 | 149 subTest("PKIX_Logger_SetMaxLoggingLevel"); |
150 if (compNameReturn != PKIX_LIST_ERROR) { | 150 PKIX_TEST_EXPECT_NO_ERROR( |
151 testError("Incorrect Logger Component returned."); | 151 PKIX_Logger_SetMaxLoggingLevel(logger, 3, plContext)); |
152 } | 152 |
153 | 153 subTest("PKIX_Logger_GetMaxLoggingLevel"); |
154 cleanup: | 154 PKIX_TEST_EXPECT_NO_ERROR( |
155 | 155 PKIX_Logger_GetMaxLoggingLevel(logger, &level, plContext)); |
156 PKIX_TEST_RETURN(); | 156 |
157 } | 157 if (level != 3) { |
158 | 158 testError("Incorrect Logger MaxLoggingLevel returned"); |
159 static void | 159 } |
160 testMaxLoggingLevel(PKIX_Logger *logger) | 160 |
161 { | 161 cleanup: |
162 PKIX_UInt32 level = 0; | 162 |
163 PKIX_TEST_STD_VARS(); | 163 PKIX_TEST_RETURN(); |
164 | 164 } |
165 subTest("PKIX_Logger_GetMaxLoggingLevel"); | 165 |
166 PKIX_TEST_EXPECT_NO_ERROR(PKIX_Logger_GetMaxLoggingLevel | 166 static void testLogger(PKIX_Logger *logger, PKIX_Logger *logger2) { |
167 (logger, &level, plContext)); | 167 PKIX_List *loggerList = NULL; |
168 | 168 PKIX_List *checkList = NULL; |
169 if (level != 0) { | 169 PKIX_UInt32 length; |
170 testError("Incorrect Logger MaxLoggingLevel returned"); | 170 PKIX_Boolean cmpResult = PKIX_FALSE; |
171 } | 171 char *expectedAscii = |
172 | 172 "[\n" |
173 subTest("PKIX_Logger_SetMaxLoggingLevel"); | 173 "\tLogger: \n" |
174 PKIX_TEST_EXPECT_NO_ERROR(PKIX_Logger_SetMaxLoggingLevel | 174 "\tContext: (null)\n" |
175 (logger, 3, plContext)); | 175 "\tMaximum Level: 3\n" |
176 | 176 "\tComponent Name: LIST\n" |
177 subTest("PKIX_Logger_GetMaxLoggingLevel"); | 177 "]\n"; |
178 PKIX_TEST_EXPECT_NO_ERROR(PKIX_Logger_GetMaxLoggingLevel | 178 |
179 (logger, &level, plContext)); | 179 PKIX_TEST_STD_VARS(); |
180 | 180 |
181 if (level != 3) { | 181 subTest("PKIX_GetLoggers"); |
182 testError("Incorrect Logger MaxLoggingLevel returned"); | 182 PKIX_TEST_EXPECT_NO_ERROR(PKIX_GetLoggers(&loggerList, plContext)); |
183 } | 183 PKIX_TEST_EXPECT_NO_ERROR( |
184 | 184 PKIX_List_GetLength(loggerList, &length, plContext)); |
185 cleanup: | 185 if (length != 0) { |
186 | 186 testError("Incorrect Logger List returned"); |
187 PKIX_TEST_RETURN(); | 187 } |
188 } | 188 PKIX_TEST_DECREF_BC(loggerList); |
189 | 189 |
190 static void | 190 PKIX_TEST_EXPECT_NO_ERROR(PKIX_List_Create(&loggerList, plContext)); |
191 testLogger(PKIX_Logger *logger, PKIX_Logger *logger2) | 191 PKIX_TEST_EXPECT_NO_ERROR( |
192 { | 192 PKIX_List_AppendItem(loggerList, (PKIX_PL_Object *)logger, plContext)); |
193 PKIX_List *loggerList = NULL; | 193 |
194 PKIX_List *checkList = NULL; | 194 subTest("PKIX_SetLoggers"); |
195 PKIX_UInt32 length; | 195 PKIX_TEST_EXPECT_NO_ERROR(PKIX_SetLoggers(loggerList, plContext)); |
196 PKIX_Boolean cmpResult = PKIX_FALSE; | 196 |
197 char *expectedAscii = "[\n" | 197 subTest("PKIX_Logger_SetLoggingComponent"); |
198 "\tLogger: \n" | 198 PKIX_TEST_EXPECT_NO_ERROR( |
199 "\tContext: (null)\n" | 199 PKIX_Logger_SetLoggingComponent(logger2, PKIX_MUTEX_ERROR, plContext)); |
200 "\tMaximum Level: 3\n" | 200 |
201 "\tComponent Name: LIST\n" | 201 subTest("PKIX_Logger_SetMaxLoggingLevel"); |
202 "]\n"; | 202 PKIX_TEST_EXPECT_NO_ERROR( |
203 | 203 PKIX_Logger_SetMaxLoggingLevel(logger2, 5, plContext)); |
204 | 204 |
205 PKIX_TEST_STD_VARS(); | 205 subTest("PKIX_AddLogger"); |
206 | 206 PKIX_TEST_EXPECT_NO_ERROR(PKIX_AddLogger(logger2, plContext)); |
207 subTest("PKIX_GetLoggers"); | 207 |
208 PKIX_TEST_EXPECT_NO_ERROR(PKIX_GetLoggers(&loggerList, plContext)); | 208 PKIX_TEST_EXPECT_NO_ERROR(PKIX_List_Create(&checkList, plContext)); |
209 PKIX_TEST_EXPECT_NO_ERROR(PKIX_List_GetLength | 209 PKIX_TEST_EXPECT_NO_ERROR( |
210 (loggerList, &length, plContext)); | 210 PKIX_List_AppendItem(checkList, (PKIX_PL_Object *)logger, plContext)); |
211 if (length != 0){ | 211 PKIX_TEST_EXPECT_NO_ERROR( |
212 testError("Incorrect Logger List returned"); | 212 PKIX_List_AppendItem(checkList, (PKIX_PL_Object *)logger2, plContext)); |
213 } | 213 |
214 PKIX_TEST_DECREF_BC(loggerList); | 214 PKIX_TEST_DECREF_BC(loggerList); |
215 | 215 |
216 PKIX_TEST_EXPECT_NO_ERROR(PKIX_List_Create(&loggerList, plContext)); | 216 subTest("PKIX_GetLoggers"); |
217 PKIX_TEST_EXPECT_NO_ERROR(PKIX_List_AppendItem | 217 PKIX_TEST_EXPECT_NO_ERROR(PKIX_GetLoggers(&loggerList, plContext)); |
218 (loggerList, (PKIX_PL_Object *) logger, plContext)); | 218 PKIX_TEST_EXPECT_NO_ERROR( |
219 | 219 PKIX_List_GetLength(loggerList, &length, plContext)); |
220 subTest("PKIX_SetLoggers"); | 220 |
221 PKIX_TEST_EXPECT_NO_ERROR(PKIX_SetLoggers(loggerList, plContext)); | 221 subTest("pkix_Loggers_Equals"); |
222 | 222 testEqualsHelper((PKIX_PL_Object *)loggerList, (PKIX_PL_Object *)checkList, |
223 subTest("PKIX_Logger_SetLoggingComponent"); | 223 PKIX_TRUE, plContext); |
224 PKIX_TEST_EXPECT_NO_ERROR(PKIX_Logger_SetLoggingComponent | 224 |
225 (logger2, PKIX_MUTEX_ERROR, plContext)); | 225 subTest("pkix_Loggers_Duplicate"); |
226 | 226 testDuplicateHelper((PKIX_PL_Object *)logger, plContext); |
227 subTest("PKIX_Logger_SetMaxLoggingLevel"); | 227 |
228 PKIX_TEST_EXPECT_NO_ERROR(PKIX_Logger_SetMaxLoggingLevel | 228 subTest("pkix_Loggers_Hashcode"); |
229 (logger2, 5, plContext)); | 229 testHashcodeHelper((PKIX_PL_Object *)logger, (PKIX_PL_Object *)logger, |
230 | 230 PKIX_TRUE, plContext); |
231 subTest("PKIX_AddLogger"); | 231 |
232 PKIX_TEST_EXPECT_NO_ERROR(PKIX_AddLogger(logger2, plContext)); | 232 subTest("pkix_Loggers_ToString"); |
233 | 233 testToStringHelper((PKIX_PL_Object *)logger, expectedAscii, plContext); |
234 PKIX_TEST_EXPECT_NO_ERROR(PKIX_List_Create(&checkList, plContext)); | 234 |
235 PKIX_TEST_EXPECT_NO_ERROR(PKIX_List_AppendItem | 235 subTest("PKIX Logger Callback"); |
236 (checkList, (PKIX_PL_Object *) logger, plContext)); | 236 subTest("Expect to have ***Fatal Error (List): Null argument*** once"); |
237 PKIX_TEST_EXPECT_NO_ERROR(PKIX_List_AppendItem | 237 PKIX_TEST_EXPECT_ERROR( |
238 (checkList, (PKIX_PL_Object *) logger2, plContext)); | 238 PKIX_List_AppendItem(NULL, (PKIX_PL_Object *)NULL, plContext)); |
239 | 239 |
240 PKIX_TEST_DECREF_BC(loggerList); | 240 cleanup: |
241 | 241 |
242 subTest("PKIX_GetLoggers"); | 242 PKIX_TEST_DECREF_AC(loggerList); |
243 PKIX_TEST_EXPECT_NO_ERROR(PKIX_GetLoggers(&loggerList, plContext)); | 243 PKIX_TEST_DECREF_AC(checkList); |
244 PKIX_TEST_EXPECT_NO_ERROR(PKIX_List_GetLength | 244 PKIX_TEST_RETURN(); |
245 (loggerList, &length, plContext)); | 245 } |
246 | 246 |
247 subTest("pkix_Loggers_Equals"); | 247 static void testDestroy(PKIX_Logger *logger) { |
248 testEqualsHelper | 248 PKIX_TEST_STD_VARS(); |
249 ((PKIX_PL_Object *) loggerList, | 249 |
250 (PKIX_PL_Object *) checkList, | 250 PKIX_TEST_DECREF_BC(logger); |
251 PKIX_TRUE, | 251 |
252 plContext); | 252 cleanup: |
253 | 253 |
254 subTest("pkix_Loggers_Duplicate"); | 254 PKIX_TEST_RETURN(); |
255 testDuplicateHelper((PKIX_PL_Object *)logger, plContext); | |
256 | |
257 subTest("pkix_Loggers_Hashcode"); | |
258 testHashcodeHelper((PKIX_PL_Object *) logger, | |
259 (PKIX_PL_Object *) logger, | |
260 PKIX_TRUE, | |
261 plContext); | |
262 | |
263 subTest("pkix_Loggers_ToString"); | |
264 testToStringHelper((PKIX_PL_Object *) logger, expectedAscii, plContext); | |
265 | |
266 subTest("PKIX Logger Callback"); | |
267 subTest("Expect to have ***Fatal Error (List): Null argument*** once"); | |
268 PKIX_TEST_EXPECT_ERROR(PKIX_List_AppendItem | |
269 (NULL, (PKIX_PL_Object *) NULL, plContext)); | |
270 | |
271 cleanup: | |
272 | |
273 PKIX_TEST_DECREF_AC(loggerList); | |
274 PKIX_TEST_DECREF_AC(checkList); | |
275 PKIX_TEST_RETURN(); | |
276 } | |
277 | |
278 static void | |
279 testDestroy(PKIX_Logger *logger) | |
280 { | |
281 PKIX_TEST_STD_VARS(); | |
282 | |
283 PKIX_TEST_DECREF_BC(logger); | |
284 | |
285 cleanup: | |
286 | |
287 PKIX_TEST_RETURN(); | |
288 } | 255 } |
289 | 256 |
290 int test_logger(int argc, char *argv[]) { | 257 int test_logger(int argc, char *argv[]) { |
291 | 258 |
292 PKIX_Logger *logger, *logger2; | 259 PKIX_Logger *logger, *logger2; |
293 PKIX_UInt32 actualMinorVersion; | 260 PKIX_UInt32 actualMinorVersion; |
294 PKIX_UInt32 j = 0; | 261 PKIX_UInt32 j = 0; |
295 | 262 |
296 PKIX_TEST_STD_VARS(); | 263 PKIX_TEST_STD_VARS(); |
297 | 264 |
298 startTests("Loggers"); | 265 startTests("Loggers"); |
299 | 266 |
300 PKIX_TEST_EXPECT_NO_ERROR( | 267 PKIX_TEST_EXPECT_NO_ERROR( |
301 PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); | 268 PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext)); |
302 | 269 |
303 subTest("PKIX_Logger_Create"); | 270 subTest("PKIX_Logger_Create"); |
304 createLogger(&logger, NULL, testLoggerCallback); | 271 createLogger(&logger, NULL, testLoggerCallback); |
305 createLogger(&logger2, (PKIX_PL_Object *)logger, testLoggerCallback2); | 272 createLogger(&logger2, (PKIX_PL_Object *)logger, testLoggerCallback2); |
306 | 273 |
307 subTest("Logger Context and Callback"); | 274 subTest("Logger Context and Callback"); |
308 testContextCallback(logger, logger2); | 275 testContextCallback(logger, logger2); |
309 | 276 |
310 subTest("Logger Component"); | 277 subTest("Logger Component"); |
311 testComponent(logger); | 278 testComponent(logger); |
312 | 279 |
313 subTest("Logger MaxLoggingLevel"); | 280 subTest("Logger MaxLoggingLevel"); |
314 testMaxLoggingLevel(logger); | 281 testMaxLoggingLevel(logger); |
315 | 282 |
316 subTest("Logger List operations"); | 283 subTest("Logger List operations"); |
317 testLogger(logger, logger2); | 284 testLogger(logger, logger2); |
318 | 285 |
319 subTest("PKIX_Logger_Destroy"); | 286 subTest("PKIX_Logger_Destroy"); |
320 testDestroy(logger); | 287 testDestroy(logger); |
321 testDestroy(logger2); | 288 testDestroy(logger2); |
322 | 289 |
323 cleanup: | 290 cleanup: |
324 | 291 |
325 PKIX_Shutdown(plContext); | 292 PKIX_Shutdown(plContext); |
326 | 293 |
327 PKIX_TEST_RETURN(); | 294 PKIX_TEST_RETURN(); |
328 | 295 |
329 endTests("Loggers"); | 296 endTests("Loggers"); |
330 | 297 |
331 return (0); | 298 return (0); |
332 | 299 } |
333 } | |
OLD | NEW |