1 : /*
2 : * This file is part of MIN Test Framework. Copyright © 2008 Nokia Corporation
3 : * and/or its subsidiary(-ies).
4 : * Contact: Konrad Marek Zapalowicz
5 : * Contact e-mail: DG.MIN-Support@nokia.com
6 : *
7 : * This program is free software: you can redistribute it and/or modify it
8 : * under the terms of the GNU General Public License as published by the Free
9 : * Software Foundation, version 2 of the License.
10 : *
11 : * This program is distributed in the hope that it will be useful, but WITHOUT
12 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 : * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 : * more details. You should have received a copy of the GNU General Public
15 : * License along with this program. If not, see
16 : * <http://www.gnu.org/licenses/>.
17 : */
18 :
19 :
20 : /**
21 : * @file min_logger_output.test
22 : * @version 0.1
23 : * @brief This file contains test for MIN Logger output plugins.
24 : */
25 :
26 : /* ------------------------------------------------------------------------- */
27 : /* INCLUDES */
28 : #include <check.h>
29 :
30 : /* ------------------------------------------------------------------------- */
31 : /* CONSTANTS */
32 : /* None */
33 :
34 : /* ------------------------------------------------------------------------- */
35 : /* MACROS */
36 : /* None */
37 :
38 : /* ------------------------------------------------------------------------- */
39 : /* DATA TYPES */
40 : /* None */
41 :
42 : /* ------------------------------------------------------------------------- */
43 : /* LOCAL FUNCTION PROTOTYPES */
44 : /* None */
45 :
46 : /* ------------------------------------------------------------------------- */
47 : /* FORWARD DECLARATIONS */
48 : /* None */
49 :
50 : /* ------------------------------------------------------------------------- */
51 : /* STRUCTURES */
52 : /* None */
53 :
54 : /* ------------------------------------------------------------------------- */
55 : /* ==================== LOCAL FUNCTIONS ==================================== */
56 : /* None */
57 :
58 : /* ------------------------------------------------------------------------- */
59 : /* ============================= TESTS ===================================== */
60 : /* ------------------------------------------------------------------------- */
61 1 : START_TEST(test_fo_create)
62 : {
63 1 : TSChar* path = INITPTR;
64 1 : TSChar* file = "somefile.txt";
65 1 : MinLoggerFileOutput* mnlo = INITPTR;
66 :
67 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 0, 0 );
68 :
69 1 : fail_unless( mnlo == INITPTR
70 : , "mnlo != INITPTR" );
71 : }
72 1 : END_TEST
73 : /* ------------------------------------------------------------------------- */
74 1 : START_TEST(test_fo_create2)
75 : {
76 1 : TSChar* path = "somepath";
77 1 : TSChar* file = INITPTR;
78 1 : MinLoggerFileOutput* mnlo = INITPTR;
79 :
80 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 0, 0 );
81 :
82 1 : fail_unless( mnlo == INITPTR
83 : , "mnlo != INITPTR" );
84 : }
85 1 : END_TEST
86 : /* ------------------------------------------------------------------------- */
87 1 : START_TEST(test_fo_create3)
88 : {
89 1 : TSChar* path = "somepath";
90 1 : TSChar* file = "";
91 1 : MinLoggerFileOutput* mnlo = INITPTR;
92 :
93 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 0, 0 );
94 :
95 1 : fail_unless( mnlo == INITPTR
96 : , "mnlo != INITPTR" );
97 : }
98 1 : END_TEST
99 : /* ------------------------------------------------------------------------- */
100 1 : START_TEST(test_fo_create4)
101 : {
102 1 : TSChar* path = "/tmp";
103 1 : TSChar* file = "testfile.txt";
104 1 : MinLoggerFileOutput* mnlo = INITPTR;
105 :
106 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 0, 0 );
107 :
108 1 : fail_unless( mnlo != INITPTR
109 : , "mnlo == INITPTR" );
110 : }
111 1 : END_TEST
112 : /* ------------------------------------------------------------------------- */
113 1 : START_TEST(test_fo_create5)
114 : {
115 1 : TSChar* path = "/tmp";
116 1 : TSChar* file = "testfile.txt";
117 1 : MinLoggerFileOutput* mnlo = INITPTR;
118 :
119 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 0, 0 );
120 :
121 1 : fail_unless( mnlo->loggertype_ == ESTxt
122 : , "Result differs from expected: loggertype=[%d]"
123 : , mnlo->loggertype_ );
124 : }
125 1 : END_TEST
126 : /* ------------------------------------------------------------------------- */
127 1 : START_TEST(test_fo_create6)
128 : {
129 1 : TSChar* path = "/tmp";
130 1 : TSChar* file = "testfile.txt";
131 1 : MinLoggerFileOutput* mnlo = INITPTR;
132 :
133 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 0, 0 );
134 :
135 1 : fail_unless( mnlo->overwrite_ == ESTrue
136 : , "Result differs from expected: overwrite=[%d]"
137 : , mnlo->overwrite_ );
138 : }
139 1 : END_TEST
140 : /* ------------------------------------------------------------------------- */
141 1 : START_TEST(test_fo_create7)
142 : {
143 1 : TSChar* path = "/tmp";
144 1 : TSChar* file = "testfile.txt";
145 1 : MinLoggerFileOutput* mnlo = INITPTR;
146 :
147 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 0, 0 );
148 :
149 1 : fail_unless( mnlo->withtimestamp_ == ESTrue
150 : , "Result differs from expected: withtimestamp=[%d]"
151 : , mnlo->withtimestamp_ );
152 : }
153 1 : END_TEST
154 : /* ------------------------------------------------------------------------- */
155 1 : START_TEST(test_fo_create8)
156 : {
157 1 : TSChar* path = "/tmp";
158 1 : TSChar* file = "testfile.txt";
159 1 : MinLoggerFileOutput* mnlo = INITPTR;
160 :
161 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 0, 0 );
162 :
163 1 : fail_unless( mnlo->withlinebreak_ == ESTrue
164 : , "Result differs from expected: withlinebreak=[%d]"
165 : , mnlo->withlinebreak_ );
166 : }
167 1 : END_TEST
168 : /* ------------------------------------------------------------------------- */
169 1 : START_TEST(test_fo_create9)
170 : {
171 1 : TSChar* path = "/tmp";
172 1 : TSChar* file = "testfile.txt";
173 1 : MinLoggerFileOutput* mnlo = INITPTR;
174 :
175 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 0, 0 );
176 :
177 1 : fail_unless( mnlo->witheventranking_ == ESTrue
178 : , "Result differs from expected: witheventranking=[%d]"
179 : , mnlo->witheventranking_ );
180 : }
181 1 : END_TEST
182 : /* ------------------------------------------------------------------------- */
183 1 : START_TEST(test_fo_create10)
184 : {
185 1 : TSChar* path = "/tmp";
186 1 : TSChar* file = "testfile.txt";
187 1 : MinLoggerFileOutput* mnlo = INITPTR;
188 :
189 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 0, 0 );
190 :
191 1 : fail_unless( mnlo->pididtologfile_ == ESTrue
192 : , "Result differs from expected: pididtologfile=[%d]"
193 : , mnlo->pididtologfile_ );
194 : }
195 1 : END_TEST
196 : /* ------------------------------------------------------------------------- */
197 1 : START_TEST(test_fo_create11)
198 : {
199 1 : TSChar* path = "/tmp";
200 1 : TSChar* file = "testfile.txt";
201 1 : MinLoggerFileOutput* mnlo = INITPTR;
202 :
203 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 0, 0 );
204 :
205 1 : fail_unless( mnlo->createlogdir_ == ESTrue
206 : , "Result differs from expected: createlogdir=[%d]"
207 : , mnlo->createlogdir_ );
208 : }
209 1 : END_TEST
210 : /* ------------------------------------------------------------------------- */
211 1 : START_TEST(test_fo_create12)
212 : {
213 1 : TSChar* path = "/tmp";
214 1 : TSChar* file = "testfile.txt";
215 1 : MinLoggerFileOutput* mnlo = INITPTR;
216 :
217 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 0, 0 );
218 :
219 1 : fail_unless( mnlo->buffersize_ == 0
220 : , "Result differs from expected: buffersize=[%d]"
221 : , mnlo->buffersize_ );
222 : }
223 1 : END_TEST
224 : /* ------------------------------------------------------------------------- */
225 1 : START_TEST(test_fo_create13)
226 : {
227 1 : TSChar* path = "/tmp";
228 1 : TSChar* file = "testfile.txt";
229 1 : MinLoggerFileOutput* mnlo = INITPTR;
230 :
231 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 0, 0 );
232 :
233 1 : fail_unless( mnlo->unicode_ == 0
234 : , "Result differs from expected: unicode=[%d]"
235 : , mnlo->unicode_ );
236 : }
237 1 : END_TEST
238 : /* ------------------------------------------------------------------------- */
239 1 : START_TEST(test_fo_create14)
240 : {
241 1 : TSChar* path = "/tmp";
242 1 : TSChar* file = "testfile.txt";
243 1 : MinLoggerFileOutput* mnlo = INITPTR;
244 :
245 1 : mnlo = fo_create( path, file, ESHtml, 1, 1, 1, 1, 1, 1, 0, 0 );
246 :
247 1 : fail_unless( mnlo->loggertype_ == ESHtml
248 : , "Result differs from expected: loggertype=[%d]"
249 : , mnlo->loggertype_ );
250 : }
251 1 : END_TEST
252 : /* ------------------------------------------------------------------------- */
253 1 : START_TEST(test_fo_create15)
254 : {
255 1 : TSChar* path = "/tmp";
256 1 : TSChar* file = "testfile.txt";
257 1 : MinLoggerFileOutput* mnlo = INITPTR;
258 :
259 1 : mnlo = fo_create( path, file, ESTxt, 0, 1, 1, 1, 1, 1, 0, 0 );
260 :
261 1 : fail_unless( mnlo->overwrite_ == ESFalse
262 : , "Result differs from expected: overwrite=[%d]"
263 : , mnlo->overwrite_ );
264 : }
265 1 : END_TEST
266 : /* ------------------------------------------------------------------------- */
267 1 : START_TEST(test_fo_create16)
268 : {
269 1 : TSChar* path = "/tmp";
270 1 : TSChar* file = "testfile.txt";
271 1 : MinLoggerFileOutput* mnlo = INITPTR;
272 :
273 1 : mnlo = fo_create( path, file, ESTxt, 1, 0, 1, 1, 1, 1, 0, 0 );
274 :
275 1 : fail_unless( mnlo->withtimestamp_ == ESFalse
276 : , "Result differs from expected: withtimestamp=[%d]"
277 : , mnlo->withtimestamp_ );
278 : }
279 1 : END_TEST
280 : /* ------------------------------------------------------------------------- */
281 1 : START_TEST(test_fo_create17)
282 : {
283 1 : TSChar* path = "/tmp";
284 1 : TSChar* file = "testfile.txt";
285 1 : MinLoggerFileOutput* mnlo = INITPTR;
286 :
287 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 0, 1, 1, 1, 0, 0 );
288 :
289 1 : fail_unless( mnlo->withlinebreak_ == ESFalse
290 : , "Result differs from expected: withlinebreak=[%d]"
291 : , mnlo->withlinebreak_ );
292 : }
293 1 : END_TEST
294 : /* ------------------------------------------------------------------------- */
295 1 : START_TEST(test_fo_create18)
296 : {
297 1 : TSChar* path = "/tmp";
298 1 : TSChar* file = "testfile.txt";
299 1 : MinLoggerFileOutput* mnlo = INITPTR;
300 :
301 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 0, 1, 1, 0, 0 );
302 :
303 1 : fail_unless( mnlo->witheventranking_ == ESFalse
304 : , "Result differs from expected: witheventranking=[%d]"
305 : , mnlo->witheventranking_ );
306 : }
307 1 : END_TEST
308 : /* ------------------------------------------------------------------------- */
309 1 : START_TEST(test_fo_create19)
310 : {
311 1 : TSChar* path = "/tmp";
312 1 : TSChar* file = "testfile.txt";
313 1 : MinLoggerFileOutput* mnlo = INITPTR;
314 :
315 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 0, 1, 0, 0 );
316 :
317 1 : fail_unless( mnlo->pididtologfile_ == ESFalse
318 : , "Result differs from expected: pididtologfile=[%d]"
319 : , mnlo->pididtologfile_ );
320 : }
321 1 : END_TEST
322 : /* ------------------------------------------------------------------------- */
323 1 : START_TEST(test_fo_create20)
324 : {
325 1 : TSChar* path = "/tmp";
326 1 : TSChar* file = "testfile.txt";
327 1 : MinLoggerFileOutput* mnlo = INITPTR;
328 :
329 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 0, 0, 0 );
330 :
331 1 : fail_unless( mnlo->createlogdir_ == ESFalse
332 : , "Result differs from expected: createlogdir=[%d]"
333 : , mnlo->createlogdir_ );
334 : }
335 1 : END_TEST
336 : /* ------------------------------------------------------------------------- */
337 1 : START_TEST(test_fo_create21)
338 : {
339 1 : TSChar* path = "/tmp";
340 1 : TSChar* file = "testfile.txt";
341 1 : MinLoggerFileOutput* mnlo = INITPTR;
342 :
343 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 512, 0 );
344 :
345 1 : fail_unless( mnlo->buffersize_ == 512
346 : , "Result differs from expected: buffersize=[%d]"
347 : , mnlo->buffersize_ );
348 : }
349 1 : END_TEST
350 : /* ------------------------------------------------------------------------- */
351 1 : START_TEST(test_fo_create22)
352 : {
353 1 : TSChar* path = "/tmp";
354 1 : TSChar* file = "testfile.txt";
355 1 : MinLoggerFileOutput* mnlo = INITPTR;
356 :
357 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 0, 1 );
358 :
359 1 : fail_unless( mnlo->unicode_ == ESTrue
360 : , "Result differs from expected: unicode=[%d]"
361 : , mnlo->unicode_ );
362 : }
363 1 : END_TEST
364 : /* ------------------------------------------------------------------------- */
365 1 : START_TEST(test_fo_create23)
366 : {
367 1 : TSChar* path = "/tmp";
368 1 : TSChar* file = "testfile.txt";
369 1 : MinLoggerFileOutput* mnlo = INITPTR;
370 :
371 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 0, 0 );
372 :
373 1 : fail_unless( mnlo->write_ == fo_write
374 : , "write_ differs from expected: write=[%p]"
375 : , mnlo->write_ );
376 : }
377 1 : END_TEST
378 : /* ------------------------------------------------------------------------- */
379 1 : START_TEST(test_fo_create24)
380 : {
381 1 : TSChar* path = "/tmp";
382 1 : TSChar* file = "testfile.txt";
383 1 : MinLoggerFileOutput* mnlo = INITPTR;
384 :
385 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 0, 0 );
386 :
387 1 : fail_unless( mnlo->destroy_ == fo_destroy
388 : , "destroy_ differs from expected: destroy=[%p]"
389 : , mnlo->destroy_ );
390 : }
391 1 : END_TEST
392 : /* ------------------------------------------------------------------------- */
393 1 : START_TEST(test_fo_create25)
394 : {
395 1 : TSChar* path = "/tmp";
396 1 : TSChar* file = "testfile.txt";
397 1 : MinLoggerFileOutput* mnlo = INITPTR;
398 :
399 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 0, 0 );
400 :
401 1 : fail_unless( mnlo->fileanddirname_ != INITPTR
402 : , "fileanddirname_ == INITPTR" );
403 : }
404 1 : END_TEST
405 : /* ------------------------------------------------------------------------- */
406 1 : START_TEST(test_fo_create26)
407 : {
408 1 : TSChar* path = "/tmp";
409 1 : TSChar* file = "testfile.txt";
410 1 : MinLoggerFileOutput* mnlo = INITPTR;
411 :
412 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 0, 1, 0, 0 );
413 :
414 1 : fail_unless( strcmp(mnlo->fileanddirname_,"/tmp/testfile.txt") == 0
415 : , "fileanddirname_ differs from expected: [%s]"
416 : , mnlo->fileanddirname_ );
417 : }
418 1 : END_TEST
419 : /* ------------------------------------------------------------------------- */
420 1 : START_TEST(test_fo_create27)
421 : {
422 1 : TSChar* path = "/tmp/";
423 1 : TSChar* file = "testfile.txt";
424 1 : MinLoggerFileOutput* mnlo = INITPTR;
425 :
426 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 0, 1, 0, 0 );
427 :
428 1 : fail_unless( strcmp(mnlo->fileanddirname_,"/tmp/testfile.txt") == 0
429 : , "fileanddirname_ differs from expected: [%s]"
430 : , mnlo->fileanddirname_ );
431 : }
432 1 : END_TEST
433 : /* ------------------------------------------------------------------------- */
434 1 : START_TEST(test_fo_create28)
435 : {
436 1 : TSChar* path = "/tmp/";
437 1 : TSChar* file = "testfile.txt";
438 1 : MinLoggerFileOutput* mnlo = INITPTR;
439 :
440 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 0, 0 );
441 :
442 1 : fail_unless( mnlo->file_ != INITPTR
443 : , "file_ differs from expected: [%p]"
444 : , mnlo->file_ );
445 : }
446 1 : END_TEST
447 : /* ------------------------------------------------------------------------- */
448 1 : START_TEST(test_fo_create29)
449 : {
450 1 : TSChar* path = "/tmp/";
451 1 : TSChar* file = "testfile.txt";
452 1 : MinLoggerFileOutput* mnlo = INITPTR;
453 :
454 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 1, 0, 0 );
455 :
456 1 : fail_unless( mnlo->isfileopen_ == ESTrue
457 : , "isfileopen_ differs from expected: [%d]"
458 : , mnlo->isfileopen_ );
459 : }
460 1 : END_TEST
461 : /* ------------------------------------------------------------------------- */
462 1 : START_TEST(test_fo_create30)
463 : {
464 1 : TSChar* path = "/tmp/uuuu";
465 1 : TSChar* file = "testfile.txt";
466 1 : MinLoggerFileOutput* mnlo = INITPTR;
467 :
468 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 0, 0, 0 );
469 :
470 1 : fail_unless( mnlo->file_ == INITPTR
471 : , "file_ differs from expected: [%d]"
472 : , mnlo->file_ );
473 : }
474 1 : END_TEST
475 : /* ------------------------------------------------------------------------- */
476 1 : START_TEST(test_fo_create31)
477 : {
478 1 : TSChar* path = "/tmp/uuuu";
479 1 : TSChar* file = "testfile.txt";
480 1 : MinLoggerFileOutput* mnlo = INITPTR;
481 :
482 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 0, 0, 0 );
483 :
484 1 : fail_unless( mnlo->isfileopen_ == ESFalse
485 : , "isfileopen_ differs from expected: [%d]"
486 : , mnlo->isfileopen_ );
487 : }
488 1 : END_TEST
489 : /* ------------------------------------------------------------------------- */
490 1 : START_TEST(test_fo_destroy)
491 : {
492 1 : MinLoggerFileOutput* mnlo = INITPTR;
493 1 : fo_destroy(&mnlo);
494 : }
495 1 : END_TEST
496 : /* ------------------------------------------------------------------------- */
497 1 : START_TEST(test_fo_destroy2)
498 : {
499 1 : TSChar* path = "/tmp";
500 1 : TSChar* file = "testfile.txt";
501 1 : MinLoggerFileOutput* mnlo = INITPTR;
502 :
503 1 : mnlo = fo_create( path, file, ESTxt, 1, 1, 1, 1, 1, 0, 0, 0 );
504 :
505 1 : fo_destroy(&mnlo);
506 :
507 1 : fail_unless( mnlo == INITPTR
508 : , "mnlo != INITPTR after destruction" );
509 : }
510 1 : END_TEST
511 : /* ------------------------------------------------------------------------- */
512 1 : START_TEST(test_fo_create_new_file_with_txt_type_and_no_pid)
513 : {
514 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
515 1 : TSChar test_path[] = "/tmp/";
516 1 : TSChar test_file[] = "testfile_create";
517 1 : TSChar* filename = NEW2( TSChar, strlen( test_path ) + strlen( test_file ) + 1 );
518 1 : int result = 0;
519 :
520 1 : slfo->loggertype_ = ESTxt;
521 1 : slfo->overwrite_ = ESFile;
522 1 : slfo->withtimestamp_ = 0;
523 1 : slfo->withlinebreak_ = 0;
524 1 : slfo->witheventranking_ = 0;
525 1 : slfo->pididtologfile_ = 0;
526 1 : slfo->createlogdir_ = 0;
527 1 : slfo->buffersize_ = 0;
528 1 : slfo->file_ = INITPTR;
529 1 : slfo->unicode_ = 0;
530 1 : slfo->isfileopen_ = 0;
531 :
532 1 : fo_create_new_file( slfo, test_path, test_file );
533 :
534 1 : sprintf( filename, "%s%s.txt", test_path, test_file );
535 1 : result = strncmp( filename, slfo->fileanddirname_, strlen( filename ) );
536 1 : fail_unless( result == 0,
537 : "Filename of Output File is not valid in data structure." );
538 : }
539 1 : END_TEST
540 : /* ------------------------------------------------------------------------- */
541 1 : START_TEST(test_fo_create_new_file_with_html_type_and_no_pid)
542 : {
543 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
544 1 : TSChar test_path[] = "/tmp/";
545 1 : TSChar test_file[] = "testfile_create";
546 1 : TSChar* filename = NEW2( TSChar, strlen( test_path ) + strlen( test_file ) + 1 );
547 1 : int result = 0;
548 :
549 1 : slfo->loggertype_ = ESHtml;
550 1 : slfo->overwrite_ = ESFile;
551 1 : slfo->withtimestamp_ = 0;
552 1 : slfo->withlinebreak_ = 0;
553 1 : slfo->witheventranking_ = 0;
554 1 : slfo->pididtologfile_ = 0;
555 1 : slfo->createlogdir_ = 0;
556 1 : slfo->buffersize_ = 0;
557 1 : slfo->file_ = INITPTR;
558 1 : slfo->unicode_ = 0;
559 1 : slfo->isfileopen_ = 0;
560 :
561 1 : fo_create_new_file( slfo, test_path, test_file );
562 :
563 1 : sprintf( filename, "%s%s.html", test_path, test_file );
564 1 : result = strncmp( filename, slfo->fileanddirname_, strlen( filename ) );
565 1 : fail_unless( result == 0,
566 : "Filename of Output File is not valid in data structure." );
567 : }
568 1 : END_TEST
569 : /* ------------------------------------------------------------------------- */
570 1 : START_TEST(test_fo_create_new_file_with_txt_type_and_pid)
571 : {
572 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
573 1 : TSChar test_path[] = "/tmp/";
574 1 : TSChar test_file[] = "testfile_create";
575 1 : TSChar* filename = NEW2( TSChar, strlen( test_path ) + strlen( test_file ) + 1 );
576 1 : TSChar* pid = INITPTR;
577 1 : TSChar* ext = INITPTR;
578 1 : int len = 0;
579 1 : int check_name = 0;
580 1 : int check_ext = 0;
581 1 : int result = 0;
582 : TSChar name[ MaxFileName ];
583 :
584 1 : slfo->loggertype_ = ESTxt;
585 1 : slfo->overwrite_ = ESFile;
586 1 : slfo->withtimestamp_ = 0;
587 1 : slfo->withlinebreak_ = 0;
588 1 : slfo->witheventranking_ = 0;
589 1 : slfo->pididtologfile_ = ESTrue;
590 1 : slfo->createlogdir_ = 0;
591 1 : slfo->buffersize_ = 0;
592 1 : slfo->file_ = INITPTR;
593 1 : slfo->unicode_ = 0;
594 1 : slfo->isfileopen_ = 0;
595 :
596 1 : fo_create_new_file( slfo, test_path, test_file );
597 :
598 1 : pid = strrchr( slfo->fileanddirname_, '_' );
599 1 : ext = strrchr( slfo->fileanddirname_, '.' );
600 1 : len = pid - slfo->fileanddirname_;
601 1 : STRCPY( name, slfo->fileanddirname_, len );
602 1 : name[ len ] = '\0';
603 :
604 1 : check_name = strncmp( name, "/tmp/testfile_create", strlen( name ) );
605 1 : check_ext = strncmp( ext, ".txt", strlen( ext ) );
606 :
607 1 : if ( ( check_name == 0 ) &&
608 : ( strlen( pid ) == 9 ) &&
609 : ( check_ext == 0 ) ) {
610 1 : result = 1;
611 : }
612 :
613 1 : fail_unless( result == 1,
614 : "Filename of Output File is not valid." );
615 : }
616 1 : END_TEST
617 : /* ------------------------------------------------------------------------- */
618 1 : START_TEST(test_fo_create_new_file_with_html_type_and_pid)
619 : {
620 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
621 1 : TSChar test_path[] = "/tmp/";
622 1 : TSChar test_file[] = "testfile_create";
623 1 : TSChar* filename = NEW2( TSChar, strlen( test_path ) + strlen( test_file ) + 1 );
624 1 : TSChar* pid = INITPTR;
625 1 : TSChar* ext = INITPTR;
626 1 : int len = 0;
627 1 : int check_name = 0;
628 1 : int check_ext = 0;
629 1 : int result = 0;
630 : TSChar name[ MaxFileName ];
631 :
632 1 : slfo->loggertype_ = ESHtml;
633 1 : slfo->overwrite_ = ESFile;
634 1 : slfo->withtimestamp_ = 0;
635 1 : slfo->withlinebreak_ = 0;
636 1 : slfo->witheventranking_ = 0;
637 1 : slfo->pididtologfile_ = ESTrue;
638 1 : slfo->createlogdir_ = 0;
639 1 : slfo->buffersize_ = 0;
640 1 : slfo->file_ = INITPTR;
641 1 : slfo->unicode_ = 0;
642 1 : slfo->isfileopen_ = 0;
643 :
644 1 : fo_create_new_file( slfo, test_path, test_file );
645 :
646 1 : pid = strrchr( slfo->fileanddirname_, '_' );
647 1 : ext = strrchr( slfo->fileanddirname_, '.' );
648 1 : len = pid - slfo->fileanddirname_;
649 1 : STRCPY( name, slfo->fileanddirname_, len );
650 1 : name[ len ] = '\0';
651 :
652 1 : check_name = strncmp( name, "/tmp/testfile_create", strlen( name ) );
653 1 : check_ext = strncmp( ext, ".html", strlen( ext ) );
654 :
655 1 : if ( ( check_name == 0 ) &&
656 : ( strlen( pid ) == 10 ) &&
657 : ( check_ext == 0 ) ) {
658 1 : result = 1;
659 : }
660 :
661 1 : fail_unless( result == 1,
662 : "Filename of Output File is not valid." );
663 : }
664 1 : END_TEST
665 : /* ------------------------------------------------------------------------- */
666 1 : START_TEST(test_fo_create_new_file_and_file_handle)
667 : {
668 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
669 1 : TSChar test_path[] = "/tmp/";
670 1 : TSChar test_file[] = "testfile_create";
671 1 : TSChar* filename = NEW2( TSChar, strlen( test_path ) + strlen( test_file ) + 1 );
672 1 : int result = 0;
673 :
674 1 : slfo->loggertype_ = ESTxt;
675 1 : slfo->overwrite_ = ESFile;
676 1 : slfo->withtimestamp_ = 0;
677 1 : slfo->withlinebreak_ = 0;
678 1 : slfo->witheventranking_ = 0;
679 1 : slfo->pididtologfile_ = 0;
680 1 : slfo->createlogdir_ = 0;
681 1 : slfo->buffersize_ = 0;
682 1 : slfo->file_ = INITPTR;
683 1 : slfo->unicode_ = 0;
684 1 : slfo->isfileopen_ = 0;
685 :
686 1 : fo_create_new_file( slfo, test_path, test_file );
687 :
688 1 : fail_unless( slfo->file_ != INITPTR,
689 : "Output File is not created." );
690 : }
691 1 : END_TEST
692 : /* ------------------------------------------------------------------------- */
693 1 : START_TEST(test_fo_create_new_file_without_last_slash)
694 : {
695 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
696 1 : TSChar test_path[] = "/tmp";
697 1 : TSChar test_file[] = "testfile_create";
698 1 : TSChar* filename = NEW2( TSChar, strlen( test_path ) + strlen( test_file ) + 1 );
699 1 : int result = 0;
700 :
701 1 : slfo->loggertype_ = ESTxt;
702 1 : slfo->overwrite_ = ESFile;
703 1 : slfo->withtimestamp_ = 0;
704 1 : slfo->withlinebreak_ = 0;
705 1 : slfo->witheventranking_ = 0;
706 1 : slfo->pididtologfile_ = 0;
707 1 : slfo->createlogdir_ = 0;
708 1 : slfo->buffersize_ = 0;
709 1 : slfo->file_ = INITPTR;
710 1 : slfo->unicode_ = 0;
711 1 : slfo->isfileopen_ = 0;
712 :
713 1 : fo_create_new_file( slfo, test_path, test_file );
714 :
715 : /* Following string format for expected path with valid slashes */
716 1 : sprintf( filename, "%s/%s", test_path, test_file );
717 1 : result = strncmp( filename, slfo->fileanddirname_, strlen( filename ) );
718 1 : fail_unless( result == 0,
719 : "Filename of Output File is not valid in data structure." );
720 : }
721 1 : END_TEST
722 : /* ------------------------------------------------------------------------- */
723 1 : START_TEST(test_fo_create_new_file_and_file_open_flag)
724 : {
725 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
726 1 : TSChar test_path[] = "/tmp/";
727 1 : TSChar test_file[] = "testfile_create";
728 1 : TSChar* filename = NEW2( TSChar, strlen( test_path ) + strlen( test_file ) + 1 );
729 1 : int result = 0;
730 :
731 1 : slfo->loggertype_ = ESTxt;
732 1 : slfo->overwrite_ = ESFile;
733 1 : slfo->withtimestamp_ = 0;
734 1 : slfo->withlinebreak_ = 0;
735 1 : slfo->witheventranking_ = 0;
736 1 : slfo->pididtologfile_ = 0;
737 1 : slfo->createlogdir_ = 0;
738 1 : slfo->buffersize_ = 0;
739 1 : slfo->file_ = INITPTR;
740 1 : slfo->unicode_ = 0;
741 1 : slfo->isfileopen_ = 0;
742 :
743 1 : fo_create_new_file( slfo, test_path, test_file );
744 :
745 1 : fail_unless( slfo->isfileopen_ == ESTrue,
746 : "Output File is not opened." );
747 : }
748 1 : END_TEST
749 : /* ------------------------------------------------------------------------- */
750 1 : START_TEST(test_fo_create_new_file_fullname_txt_and_pid)
751 : {
752 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
753 1 : TSChar test_path[] = "/tmp/";
754 1 : TSChar test_file[] = "testfile_create.txt";
755 1 : TSChar* pid = INITPTR;
756 1 : TSChar* ext = INITPTR;
757 1 : int len = 0;
758 1 : int check_name = 0;
759 1 : int check_ext = 0;
760 1 : int result = 0;
761 : TSChar name[ MaxFileName ];
762 :
763 1 : slfo->loggertype_ = ESTxt;
764 1 : slfo->overwrite_ = ESFile;
765 1 : slfo->withtimestamp_ = 0;
766 1 : slfo->withlinebreak_ = 0;
767 1 : slfo->witheventranking_ = 0;
768 1 : slfo->pididtologfile_ = ESTrue;
769 1 : slfo->createlogdir_ = 0;
770 1 : slfo->buffersize_ = 0;
771 1 : slfo->file_ = INITPTR;
772 1 : slfo->unicode_ = 0;
773 1 : slfo->isfileopen_ = 0;
774 :
775 1 : fo_create_new_file( slfo, test_path, test_file );
776 :
777 1 : pid = strrchr( slfo->fileanddirname_, '_' );
778 1 : ext = strrchr( slfo->fileanddirname_, '.' );
779 1 : len = pid - slfo->fileanddirname_;
780 1 : STRCPY( name, slfo->fileanddirname_, len );
781 1 : name[ len ] = '\0';
782 :
783 1 : check_name = strncmp( name, "/tmp/testfile_create", strlen( name ) );
784 1 : check_ext = strncmp( ext, ".txt", strlen( ext ) );
785 :
786 1 : if ( ( check_name == 0 ) &&
787 : ( strlen( pid ) == 9 ) &&
788 : ( check_ext == 0 ) ) {
789 1 : result = 1;
790 : }
791 :
792 1 : fail_unless( result == 1,
793 : "Filename of Output File is not valid." );
794 : }
795 1 : END_TEST
796 : /* ------------------------------------------------------------------------- */
797 1 : START_TEST(test_fo_create_new_file_fullname_html_and_pid)
798 : {
799 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
800 1 : TSChar test_path[] = "/tmp/";
801 1 : TSChar test_file[] = "testfile_create.html";
802 1 : TSChar* pid = INITPTR;
803 1 : TSChar* ext = INITPTR;
804 1 : int len = 0;
805 1 : int check_name = 0;
806 1 : int check_ext = 0;
807 1 : int result = 0;
808 : TSChar name[ MaxFileName ];
809 :
810 1 : slfo->loggertype_ = ESTxt;
811 1 : slfo->overwrite_ = ESFile;
812 1 : slfo->withtimestamp_ = 0;
813 1 : slfo->withlinebreak_ = 0;
814 1 : slfo->witheventranking_ = 0;
815 1 : slfo->pididtologfile_ = ESTrue;
816 1 : slfo->createlogdir_ = 0;
817 1 : slfo->buffersize_ = 0;
818 1 : slfo->file_ = INITPTR;
819 1 : slfo->unicode_ = 0;
820 1 : slfo->isfileopen_ = 0;
821 :
822 1 : fo_create_new_file( slfo, test_path, test_file );
823 :
824 1 : pid = strrchr( slfo->fileanddirname_, '_' );
825 1 : ext = strrchr( slfo->fileanddirname_, '.' );
826 1 : len = pid - slfo->fileanddirname_;
827 1 : STRCPY( name, slfo->fileanddirname_, len );
828 1 : name[ len ] = '\0';
829 :
830 1 : check_name = strncmp( name, "/tmp/testfile_create", strlen( name ) );
831 1 : check_ext = strncmp( ext, ".html", strlen( ext ) );
832 :
833 1 : if ( ( check_name == 0 ) &&
834 : ( strlen( pid ) == 10 ) &&
835 : ( check_ext == 0 ) ) {
836 1 : result = 1;
837 : }
838 :
839 1 : fail_unless( result == 1,
840 : "Filename of Output File is not valid." );
841 : }
842 1 : END_TEST
843 : /* ------------------------------------------------------------------------- */
844 1 : START_TEST(test_fo_create_new_file_name_without_txt_pid_use)
845 : {
846 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
847 1 : TSChar test_path[] = "/tmp/";
848 1 : TSChar test_file[] = "testfile_create";
849 1 : TSChar* pid = INITPTR;
850 1 : TSChar* ext = INITPTR;
851 1 : int len = 0;
852 1 : int check_name = 0;
853 1 : int check_ext = 0;
854 1 : int result = 0;
855 : TSChar name[ MaxFileName ];
856 :
857 1 : slfo->loggertype_ = ESTxt;
858 1 : slfo->overwrite_ = ESFile;
859 1 : slfo->withtimestamp_ = 0;
860 1 : slfo->withlinebreak_ = 0;
861 1 : slfo->witheventranking_ = 0;
862 1 : slfo->pididtologfile_ = ESTrue;
863 1 : slfo->createlogdir_ = 0;
864 1 : slfo->buffersize_ = 0;
865 1 : slfo->file_ = INITPTR;
866 1 : slfo->unicode_ = 0;
867 1 : slfo->isfileopen_ = 0;
868 :
869 1 : fo_create_new_file( slfo, test_path, test_file );
870 :
871 1 : pid = strrchr( slfo->fileanddirname_, '_' );
872 1 : ext = strrchr( slfo->fileanddirname_, '.' );
873 1 : len = pid - slfo->fileanddirname_;
874 1 : STRCPY( name, slfo->fileanddirname_, len );
875 1 : name[ len ] = '\0';
876 :
877 1 : check_name = strncmp( name, "/tmp/testfile_create", strlen( name ) );
878 1 : check_ext = strncmp( ext, ".txt", strlen( ext ) );
879 :
880 1 : if ( ( check_name == 0 ) &&
881 : ( strlen( pid ) == 9 ) &&
882 : ( check_ext == 0 ) ) {
883 1 : result = 1;
884 : }
885 :
886 1 : fail_unless( result == 1,
887 : "Filename of Output File is not valid." );
888 : }
889 1 : END_TEST
890 : /* ------------------------------------------------------------------------- */
891 1 : START_TEST(test_fo_create_new_file_name_without_html_pid_use)
892 : {
893 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
894 1 : TSChar test_path[] = "/tmp/";
895 1 : TSChar test_file[] = "testfile_create";
896 1 : TSChar* pid = INITPTR;
897 1 : TSChar* ext = INITPTR;
898 1 : int len = 0;
899 1 : int check_name = 0;
900 1 : int check_ext = 0;
901 1 : int result = 0;
902 : TSChar name[ MaxFileName ];
903 :
904 1 : slfo->loggertype_ = ESHtml;
905 1 : slfo->overwrite_ = ESFile;
906 1 : slfo->withtimestamp_ = 0;
907 1 : slfo->withlinebreak_ = 0;
908 1 : slfo->witheventranking_ = 0;
909 1 : slfo->pididtologfile_ = ESTrue;
910 1 : slfo->createlogdir_ = 0;
911 1 : slfo->buffersize_ = 0;
912 1 : slfo->file_ = INITPTR;
913 1 : slfo->unicode_ = 0;
914 1 : slfo->isfileopen_ = 0;
915 :
916 1 : fo_create_new_file( slfo, test_path, test_file );
917 :
918 1 : pid = strrchr( slfo->fileanddirname_, '_' );
919 1 : ext = strrchr( slfo->fileanddirname_, '.' );
920 1 : len = pid - slfo->fileanddirname_;
921 1 : STRCPY( name, slfo->fileanddirname_, len );
922 1 : name[ len ] = '\0';
923 :
924 1 : check_name = strncmp( name, "/tmp/testfile_create", strlen( name ) );
925 1 : check_ext = strncmp( ext, ".html", strlen( ext ) );
926 :
927 1 : if ( ( check_name == 0 ) &&
928 : ( strlen( pid ) == 10 ) &&
929 : ( check_ext == 0 ) ) {
930 1 : result = 1;
931 : }
932 :
933 1 : fail_unless( result == 1,
934 : "Filename of Output File is not valid." );
935 : }
936 1 : END_TEST
937 : /* ------------------------------------------------------------------------- */
938 1 : START_TEST(test_fo_open_existing_file_with_txt_type_and_pid)
939 : {
940 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
941 1 : TSChar test_path[] = "/tmp/";
942 1 : TSChar test_file[] = "testfile_open";
943 1 : TSChar* filename = NEW2( TSChar, strlen( test_path ) + strlen( test_file ) + 1 );
944 1 : int result = 0;
945 :
946 1 : slfo->loggertype_ = ESTxt;
947 1 : slfo->overwrite_ = ESFile;
948 1 : slfo->withtimestamp_ = 0;
949 1 : slfo->withlinebreak_ = 0;
950 1 : slfo->witheventranking_ = 0;
951 1 : slfo->pididtologfile_ = ESTrue;
952 1 : slfo->createlogdir_ = 0;
953 1 : slfo->buffersize_ = 0;
954 1 : slfo->file_ = INITPTR;
955 1 : slfo->unicode_ = 0;
956 1 : slfo->isfileopen_ = ESFalse;
957 :
958 1 : fo_create_new_file( slfo, test_path, test_file );
959 1 : fo_open_existing_file( slfo, test_path, test_file );
960 :
961 1 : sprintf( filename, "%s%s", test_path, test_file );
962 1 : result = strncmp( filename, slfo->fileanddirname_, strlen( filename ) );
963 :
964 1 : fail_unless( result == 0,
965 : "Filename of Output File is not valid in data structure." );
966 : }
967 1 : END_TEST
968 : /* ------------------------------------------------------------------------- */
969 1 : START_TEST(test_fo_open_existing_file_with_html_type_and_pid)
970 : {
971 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
972 1 : TSChar test_path[] = "/tmp/";
973 1 : TSChar test_file[] = "testfile_open";
974 1 : TSChar* filename = NEW2( TSChar, strlen( test_path ) + strlen( test_file ) + 1 );
975 1 : int result = 0;
976 :
977 1 : slfo->loggertype_ = ESHtml;
978 1 : slfo->overwrite_ = ESFile;
979 1 : slfo->withtimestamp_ = 0;
980 1 : slfo->withlinebreak_ = 0;
981 1 : slfo->witheventranking_ = 0;
982 1 : slfo->pididtologfile_ = ESTrue;
983 1 : slfo->createlogdir_ = 0;
984 1 : slfo->buffersize_ = 0;
985 1 : slfo->file_ = INITPTR;
986 1 : slfo->unicode_ = 0;
987 1 : slfo->isfileopen_ = ESFalse;
988 :
989 1 : fo_create_new_file( slfo, test_path, test_file );
990 1 : fo_open_existing_file( slfo, test_path, test_file );
991 :
992 1 : sprintf( filename, "%s%s", test_path, test_file );
993 1 : result = strncmp( filename, slfo->fileanddirname_, strlen( filename ) );
994 :
995 1 : fail_unless( result == 0,
996 : "Filename of Output File is not valid in data structure." );
997 : }
998 1 : END_TEST
999 : /* ------------------------------------------------------------------------- */
1000 1 : START_TEST(test_fo_open_existing_file_with_txt_type_no_pid)
1001 : {
1002 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1003 1 : TSChar test_path[] = "/tmp/";
1004 1 : TSChar test_file[] = "testfile_open";
1005 1 : TSChar* filename = NEW2( TSChar, strlen( test_path ) + strlen( test_file ) + 1 );
1006 1 : int result = 0;
1007 :
1008 1 : slfo->loggertype_ = ESTxt;
1009 1 : slfo->overwrite_ = ESFile;
1010 1 : slfo->withtimestamp_ = 0;
1011 1 : slfo->withlinebreak_ = 0;
1012 1 : slfo->witheventranking_ = 0;
1013 1 : slfo->pididtologfile_ = 0;
1014 1 : slfo->createlogdir_ = 0;
1015 1 : slfo->buffersize_ = 0;
1016 1 : slfo->file_ = INITPTR;
1017 1 : slfo->unicode_ = 0;
1018 1 : slfo->isfileopen_ = ESFalse;
1019 :
1020 1 : fo_create_new_file( slfo, test_path, test_file );
1021 1 : fo_open_existing_file( slfo, test_path, test_file );
1022 :
1023 1 : sprintf( filename, "%s%s", test_path, test_file );
1024 1 : result = strncmp( filename, slfo->fileanddirname_, strlen( filename ) );
1025 :
1026 1 : fail_unless( result == 0,
1027 : "Filename of Output File is not valid in data structure." );
1028 : }
1029 1 : END_TEST
1030 : /* ------------------------------------------------------------------------- */
1031 1 : START_TEST(test_fo_open_existing_file_with_html_type_no_pid)
1032 : {
1033 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1034 1 : TSChar test_path[] = "/tmp/";
1035 1 : TSChar test_file[] = "testfile_open";
1036 1 : TSChar* filename = NEW2( TSChar, strlen( test_path ) + strlen( test_file ) + 1 );
1037 1 : int result = 0;
1038 :
1039 1 : slfo->loggertype_ = ESHtml;
1040 1 : slfo->overwrite_ = ESFile;
1041 1 : slfo->withtimestamp_ = 0;
1042 1 : slfo->withlinebreak_ = 0;
1043 1 : slfo->witheventranking_ = 0;
1044 1 : slfo->pididtologfile_ = 0;
1045 1 : slfo->createlogdir_ = 0;
1046 1 : slfo->buffersize_ = 0;
1047 1 : slfo->file_ = INITPTR;
1048 1 : slfo->unicode_ = 0;
1049 1 : slfo->isfileopen_ = ESFalse;
1050 :
1051 1 : fo_create_new_file( slfo, test_path, test_file );
1052 1 : fo_open_existing_file( slfo, test_path, test_file );
1053 :
1054 1 : sprintf( filename, "%s%s", test_path, test_file );
1055 1 : result = strncmp( filename, slfo->fileanddirname_, strlen( filename ) );
1056 :
1057 1 : fail_unless( result == 0,
1058 : "Filename of Output File is not valid in data structure." );
1059 : }
1060 1 : END_TEST
1061 : /* ------------------------------------------------------------------------- */
1062 1 : START_TEST(test_fo_open_existing_file_with_filetype_and_no_pid)
1063 : {
1064 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1065 1 : TSChar test_path[] = "/tmp/";
1066 1 : TSChar test_file[] = "testfile_open.txt";
1067 1 : TSChar* filename = NEW2( TSChar, strlen( test_path ) + strlen( test_file ) + 1 );
1068 1 : int result = 0;
1069 :
1070 1 : slfo->loggertype_ = ESTxt;
1071 1 : slfo->overwrite_ = ESFile;
1072 1 : slfo->withtimestamp_ = 0;
1073 1 : slfo->withlinebreak_ = 0;
1074 1 : slfo->witheventranking_ = 0;
1075 1 : slfo->pididtologfile_ = 0;
1076 1 : slfo->createlogdir_ = 0;
1077 1 : slfo->buffersize_ = 0;
1078 1 : slfo->file_ = INITPTR;
1079 1 : slfo->unicode_ = 0;
1080 1 : slfo->isfileopen_ = ESFalse;
1081 :
1082 1 : fo_create_new_file( slfo, test_path, test_file );
1083 1 : fo_open_existing_file( slfo, test_path, test_file );
1084 :
1085 1 : sprintf( filename, "%s%s", test_path, test_file );
1086 1 : result = strncmp( filename, slfo->fileanddirname_, strlen( filename ) );
1087 :
1088 1 : fail_unless( result == 0,
1089 : "Filename of Output File is not valid in data structure." );
1090 : }
1091 1 : END_TEST
1092 : /* ------------------------------------------------------------------------- */
1093 0 : START_TEST(test_fo_open_existing_file_with_filetype_and_pid)
1094 : {
1095 0 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1096 0 : TSChar test_path[] = "/tmp/";
1097 0 : TSChar test_file[] = "testfile_open.html";
1098 0 : TSChar* filename = NEW2( TSChar, strlen( test_path ) + strlen( test_file ) + 1 );
1099 0 : int result = 0;
1100 :
1101 0 : slfo->loggertype_ = ESHtml;
1102 0 : slfo->overwrite_ = ESFile;
1103 0 : slfo->withtimestamp_ = 0;
1104 0 : slfo->withlinebreak_ = 0;
1105 0 : slfo->witheventranking_ = 0;
1106 0 : slfo->pididtologfile_ = ESTrue;
1107 0 : slfo->createlogdir_ = 0;
1108 0 : slfo->buffersize_ = 0;
1109 0 : slfo->file_ = INITPTR;
1110 0 : slfo->unicode_ = 0;
1111 0 : slfo->isfileopen_ = ESFalse;
1112 :
1113 0 : fo_create_new_file( slfo, test_path, test_file );
1114 0 : fo_open_existing_file( slfo, test_path, test_file );
1115 :
1116 0 : sprintf( filename, "%s%s", test_path, test_file );
1117 0 : result = strncmp( filename, slfo->fileanddirname_, strlen( filename ) );
1118 :
1119 0 : fail_unless( result == 0,
1120 : "Filename of Output File is not valid in data structure." );
1121 : }
1122 0 : END_TEST
1123 : /* ------------------------------------------------------------------------- */
1124 1 : START_TEST(test_fo_open_existing_file_without_last_slash)
1125 : {
1126 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1127 1 : TSChar test_path[] = "/tmp";
1128 1 : TSChar test_file[] = "testfile_open";
1129 1 : TSChar* filename = NEW2( TSChar, strlen( test_path ) + strlen( test_file ) + 1 );
1130 1 : int result = 0;
1131 :
1132 1 : slfo->loggertype_ = ESHtml;
1133 1 : slfo->overwrite_ = ESFile;
1134 1 : slfo->withtimestamp_ = 0;
1135 1 : slfo->withlinebreak_ = 0;
1136 1 : slfo->witheventranking_ = 0;
1137 1 : slfo->pididtologfile_ = 0;
1138 1 : slfo->createlogdir_ = 0;
1139 1 : slfo->buffersize_ = 0;
1140 1 : slfo->file_ = INITPTR;
1141 1 : slfo->unicode_ = 0;
1142 1 : slfo->isfileopen_ = ESFalse;
1143 :
1144 1 : fo_create_new_file( slfo, test_path, test_file );
1145 1 : fo_open_existing_file( slfo, test_path, test_file );
1146 :
1147 : /* Following string format for expected path with valid slashes */
1148 1 : sprintf( filename, "%s/%s", test_path, test_file );
1149 1 : result = strncmp( filename, slfo->fileanddirname_, strlen( filename ) );
1150 :
1151 1 : fail_unless( result == 0,
1152 : "Filename of Output File has not valid path slashes." );
1153 : }
1154 1 : END_TEST
1155 : /* ------------------------------------------------------------------------- */
1156 1 : START_TEST(test_fo_open_existing_file_and_file_handle)
1157 : {
1158 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1159 1 : TSChar test_path[] = "/tmp/";
1160 1 : TSChar test_file[] = "testfile_open";
1161 :
1162 1 : slfo->loggertype_ = ESTxt;
1163 1 : slfo->overwrite_ = ESFile;
1164 1 : slfo->withtimestamp_ = 0;
1165 1 : slfo->withlinebreak_ = 0;
1166 1 : slfo->witheventranking_ = 0;
1167 1 : slfo->pididtologfile_ = 0;
1168 1 : slfo->createlogdir_ = 0;
1169 1 : slfo->buffersize_ = 0;
1170 1 : slfo->file_ = INITPTR;
1171 1 : slfo->unicode_ = 0;
1172 1 : slfo->isfileopen_ = ESFalse;
1173 :
1174 1 : fo_create_new_file( slfo, test_path, test_file );
1175 1 : fo_open_existing_file( slfo, test_path, test_file );
1176 :
1177 1 : fail_unless( slfo->file_ != INITPTR,
1178 : "Output File handle is not created." );
1179 : }
1180 1 : END_TEST
1181 : /* ------------------------------------------------------------------------- */
1182 1 : START_TEST(test_fo_open_existing_file_and_file_open_flag)
1183 : {
1184 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1185 1 : TSChar test_path[] = "/tmp/";
1186 1 : TSChar test_file[] = "testfile_open";
1187 :
1188 1 : slfo->loggertype_ = ESTxt;
1189 1 : slfo->overwrite_ = ESFile;
1190 1 : slfo->withtimestamp_ = 0;
1191 1 : slfo->withlinebreak_ = 0;
1192 1 : slfo->witheventranking_ = 0;
1193 1 : slfo->pididtologfile_ = 0;
1194 1 : slfo->createlogdir_ = 0;
1195 1 : slfo->buffersize_ = 0;
1196 1 : slfo->file_ = INITPTR;
1197 1 : slfo->unicode_ = 0;
1198 1 : slfo->isfileopen_ = ESFalse;
1199 :
1200 1 : fo_create_new_file( slfo, test_path, test_file );
1201 1 : fo_open_existing_file( slfo, test_path, test_file );
1202 :
1203 1 : fail_unless( slfo->isfileopen_ == ESTrue,
1204 : "Output File is not opened." );
1205 : }
1206 1 : END_TEST
1207 : /* ------------------------------------------------------------------------- */
1208 1 : START_TEST(test_fo_event_ranking)
1209 : {
1210 1 : TSChar* tmp = INITPTR;
1211 1 : fo_event_ranking(tmp);
1212 1 : fail_unless( tmp == INITPTR, "tmp != INITPTR" );
1213 : }
1214 1 : END_TEST
1215 : /* ------------------------------------------------------------------------- */
1216 1 : START_TEST(test_fo_event_ranking2)
1217 : {
1218 : TSChar tmp[11];
1219 1 : memset(tmp,'\0',11);
1220 1 : fo_event_ranking(tmp);
1221 1 : fail_unless( tmp != INITPTR, "tmp == INITPTR" );
1222 : }
1223 1 : END_TEST
1224 : /* ------------------------------------------------------------------------- */
1225 1 : START_TEST(test_fo_event_ranking3)
1226 : {
1227 : TSChar tmp[11];
1228 1 : memset(tmp,'\0',11);
1229 1 : fo_event_ranking(tmp);
1230 1 : fail_unless( strlen(tmp) == 9
1231 : , "Event ranking length differs from expected [%d]"
1232 : , strlen(tmp) );
1233 : }
1234 1 : END_TEST
1235 : /* ------------------------------------------------------------------------- */
1236 0 : START_TEST(test_fo_open_existing_file_without_filetype)
1237 : {
1238 0 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1239 0 : TSChar test_path[] = "/tmp/";
1240 0 : TSChar test_file[] = "testfile_open";
1241 0 : TSChar* filename = NEW2( TSChar, strlen( test_path ) + strlen( test_file ) + 1 );
1242 0 : int result = 0;
1243 :
1244 0 : slfo->fileanddirname_ = INITPTR;
1245 0 : slfo->loggertype_ = ESTxt;
1246 0 : slfo->overwrite_ = ESFile;
1247 0 : slfo->withtimestamp_ = 0;
1248 0 : slfo->withlinebreak_ = 0;
1249 0 : slfo->witheventranking_ = 0;
1250 0 : slfo->pididtologfile_ = 1;
1251 0 : slfo->createlogdir_ = 0;
1252 0 : slfo->buffersize_ = 0;
1253 0 : slfo->file_ = INITPTR;
1254 0 : slfo->unicode_ = 0;
1255 0 : slfo->isfileopen_ = ESFalse;
1256 :
1257 0 : fo_create_new_file( slfo, test_path, test_file );
1258 :
1259 : /* Modified new filename length must be 4 chars over original
1260 : New filename = Path + Filenam + '.' + filetype (min. 3 chars) */
1261 0 : if ( strlen( slfo->fileanddirname_ ) > ( strlen( test_path ) + strlen( test_file + 4 ) ) ) {
1262 0 : result = 1;
1263 : }
1264 :
1265 0 : fail_unless( result == 1,
1266 : "Filename and filetype is not valid." );
1267 : }
1268 0 : END_TEST
1269 : /* ------------------------------------------------------------------------- */
1270 1 : START_TEST(test_fo_add_timestamp_to_data)
1271 : {
1272 1 : TSChar* test_data = NEW2( TSChar, 40 );
1273 1 : int day = 0;
1274 1 : int year = 0;
1275 1 : int hour = 0;
1276 1 : int minute = 0;
1277 1 : int sec = 0;
1278 1 : int msec = 0;
1279 1 : int result = 0;
1280 1 : int result_ok = 7; /* Valid time variables sum is 7 */
1281 : TSChar month[5];
1282 :
1283 : /*
1284 : Timestamp string format: "DD.MON.YEAR HH:MM:SS.MSC"
1285 : DD = Day number (01-31)
1286 : MON = Month number (01-12)
1287 : YEAR = Year number (19xx)
1288 : HH = Hours (00-11)
1289 : MM = Minutes (00-59)
1290 : SS = Seconds (00-59)
1291 : MSC = Microseconds (000-999)
1292 : */
1293 :
1294 1 : fo_add_timestamp_to_data( test_data );
1295 1 : sscanf( test_data, "%2d.%3s.%4d %2d:%2d:%2d.%3d",
1296 : &day, month, &year, &hour, &minute, &sec, &msec );
1297 :
1298 1 : if ( ( day >= 1 ) && ( day <= 31 ) ) { result++; }
1299 1 : if ( strlen( month ) == 3 ) { result++; }
1300 1 : if ( year > 1900 ) { result++; }
1301 1 : if ( ( hour >= 0 ) && ( hour <= 23 ) ) { result++; }
1302 1 : if ( ( minute >= 0 ) && ( minute <= 59 ) ) { result++; }
1303 1 : if ( ( sec >= 0 ) && ( sec <= 59 ) ) { result++; }
1304 1 : if ( ( msec >= 0 ) && ( msec <= 999 ) ) { result++; }
1305 :
1306 1 : fail_unless( result == result_ok,
1307 : "Add Timestamp to File Output data failed." );
1308 : }
1309 1 : END_TEST
1310 : /* ------------------------------------------------------------------------- */
1311 1 : START_TEST(test_fo_test_file_with_pid)
1312 : {
1313 1 : TSChar file[] = "";
1314 : TSChar newfile[MaxFileName];
1315 1 : memset(newfile,'\0',MaxFileName);
1316 1 : sprintf(newfile,"%s","aaa");
1317 :
1318 1 : fo_test_file_with_pid(file,newfile);
1319 :
1320 1 : fail_unless( strcmp(newfile,"aaa") == 0
1321 : , "Result differs from expected [%s]"
1322 : , newfile );
1323 : }
1324 1 : END_TEST
1325 : /* ------------------------------------------------------------------------- */
1326 1 : START_TEST(test_fo_test_file_with_pid2)
1327 : {
1328 1 : TSChar* file = INITPTR;
1329 : TSChar newfile[MaxFileName];
1330 1 : memset(newfile,'\0',MaxFileName);
1331 1 : sprintf(newfile,"%s","aaa");
1332 :
1333 1 : fo_test_file_with_pid(file,newfile);
1334 :
1335 1 : fail_unless( strcmp(newfile,"aaa") == 0
1336 : , "Result differs from expected [%s]"
1337 : , newfile );
1338 : }
1339 1 : END_TEST
1340 : /* ------------------------------------------------------------------------- */
1341 1 : START_TEST(test_fo_test_file_with_pid3)
1342 : {
1343 1 : TSChar file[] = "file";
1344 1 : TSChar* newfile = INITPTR;
1345 :
1346 1 : fo_test_file_with_pid(file,newfile);
1347 :
1348 1 : fail_unless( newfile == INITPTR
1349 : , "Result differs from expected: newfile!=INITPTR");
1350 : }
1351 1 : END_TEST
1352 : /* ------------------------------------------------------------------------- */
1353 1 : START_TEST(test_fo_test_file_with_pid4)
1354 : {
1355 1 : TSChar file[] = "file";
1356 : TSChar newfile[MaxFileName];
1357 1 : memset(newfile,'\0',MaxFileName);
1358 :
1359 1 : fo_test_file_with_pid(file,newfile);
1360 :
1361 1 : fail_unless( strlen(newfile) != 0
1362 : , "Result differs from expected: slrlen(newfile)==0");
1363 : }
1364 1 : END_TEST
1365 : /* ------------------------------------------------------------------------- */
1366 1 : START_TEST(test_fo_test_file_with_pid5)
1367 : {
1368 1 : TSChar file[] = "file";
1369 : TSChar newfile[MaxFileName];
1370 1 : memset(newfile,'\0',MaxFileName);
1371 :
1372 1 : fo_test_file_with_pid(file,newfile);
1373 :
1374 1 : fail_unless( strcmp(newfile,file) == 0
1375 : , "Result differs from expected: [%s]"
1376 : , newfile );
1377 : }
1378 1 : END_TEST
1379 : /* ------------------------------------------------------------------------- */
1380 1 : START_TEST(test_fo_test_file_with_pid6)
1381 : {
1382 1 : TSChar file[] = "file.txt";
1383 : TSChar newfile[MaxFileName];
1384 1 : memset(newfile,'\0',MaxFileName);
1385 :
1386 1 : fo_test_file_with_pid(file,newfile);
1387 :
1388 1 : fail_unless( strlen(newfile) != 0
1389 : , "Result differs from expected: slrlen(newfile)==0");
1390 : }
1391 1 : END_TEST
1392 : /* ------------------------------------------------------------------------- */
1393 1 : START_TEST(test_fo_test_file_with_pid7)
1394 : {
1395 1 : TSChar file[] = "file.txt";
1396 : TSChar newfile[MaxFileName];
1397 1 : memset(newfile,'\0',MaxFileName);
1398 :
1399 1 : fo_test_file_with_pid(file,newfile);
1400 :
1401 1 : fail_unless( newfile[0] == '_'
1402 : , "Result differs from expected: newfile == %s"
1403 : , newfile );
1404 : }
1405 1 : END_TEST
1406 : /* ------------------------------------------------------------------------- */
1407 1 : START_TEST(test_fo_file_type)
1408 : {
1409 1 : char* filetype = INITPTR;
1410 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1411 1 : slfo->loggertype_ = ESTxt;
1412 1 : slfo->overwrite_ = ESFile;
1413 1 : slfo->withtimestamp_ = 1;
1414 1 : slfo->withlinebreak_ = 1;
1415 1 : slfo->witheventranking_ = 0;
1416 1 : slfo->pididtologfile_ = 1;
1417 1 : slfo->createlogdir_ = 0;
1418 1 : slfo->buffersize_ = 0;
1419 1 : slfo->unicode_ = 0;
1420 1 : slfo->isfileopen_ = 0;
1421 :
1422 1 : fo_file_type( slfo, "file.txt", &filetype );
1423 :
1424 1 : fail_unless( filetype != INITPTR
1425 : , "filetype == INITPTR" );
1426 : }
1427 1 : END_TEST
1428 : /* ------------------------------------------------------------------------- */
1429 1 : START_TEST(test_fo_file_type2)
1430 : {
1431 1 : char* filetype = INITPTR;
1432 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1433 1 : slfo->loggertype_ = ESHtml;
1434 1 : slfo->overwrite_ = ESFile;
1435 1 : slfo->withtimestamp_ = 1;
1436 1 : slfo->withlinebreak_ = 1;
1437 1 : slfo->witheventranking_ = 0;
1438 1 : slfo->pididtologfile_ = 1;
1439 1 : slfo->createlogdir_ = 0;
1440 1 : slfo->buffersize_ = 0;
1441 1 : slfo->unicode_ = 0;
1442 1 : slfo->isfileopen_ = 0;
1443 :
1444 1 : fo_file_type( slfo, "file.html", &filetype );
1445 :
1446 1 : fail_unless( filetype != INITPTR
1447 : , "filetype == INITPTR" );
1448 : }
1449 1 : END_TEST
1450 : /* ------------------------------------------------------------------------- */
1451 1 : START_TEST(test_fo_file_type3)
1452 : {
1453 1 : char* filetype = INITPTR;
1454 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1455 1 : slfo->loggertype_ = ESData;
1456 1 : slfo->overwrite_ = ESFile;
1457 1 : slfo->withtimestamp_ = 1;
1458 1 : slfo->withlinebreak_ = 1;
1459 1 : slfo->witheventranking_ = 0;
1460 1 : slfo->pididtologfile_ = 1;
1461 1 : slfo->createlogdir_ = 0;
1462 1 : slfo->buffersize_ = 0;
1463 1 : slfo->unicode_ = 0;
1464 1 : slfo->isfileopen_ = 0;
1465 :
1466 1 : fo_file_type( slfo, "file.sth", &filetype );
1467 :
1468 1 : fail_unless( filetype != INITPTR
1469 : , "filetype == INITPTR" );
1470 : }
1471 1 : END_TEST
1472 : /* ------------------------------------------------------------------------- */
1473 1 : START_TEST(test_fo_file_type4)
1474 : {
1475 1 : char* filetype = INITPTR;
1476 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1477 1 : slfo->loggertype_ = ESTxt;
1478 1 : slfo->overwrite_ = ESFile;
1479 1 : slfo->withtimestamp_ = 1;
1480 1 : slfo->withlinebreak_ = 1;
1481 1 : slfo->witheventranking_ = 0;
1482 1 : slfo->pididtologfile_ = 1;
1483 1 : slfo->createlogdir_ = 0;
1484 1 : slfo->buffersize_ = 0;
1485 1 : slfo->unicode_ = 0;
1486 1 : slfo->isfileopen_ = 0;
1487 :
1488 1 : fo_file_type( slfo, "file", &filetype );
1489 :
1490 1 : fail_unless( filetype != INITPTR
1491 : , "filetype == INITPTR" );
1492 : }
1493 1 : END_TEST
1494 : /* ------------------------------------------------------------------------- */
1495 1 : START_TEST(test_fo_file_type5)
1496 : {
1497 1 : char* filetype = INITPTR;
1498 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1499 1 : slfo->loggertype_ = ESHtml;
1500 1 : slfo->overwrite_ = ESFile;
1501 1 : slfo->withtimestamp_ = 1;
1502 1 : slfo->withlinebreak_ = 1;
1503 1 : slfo->witheventranking_ = 0;
1504 1 : slfo->pididtologfile_ = 1;
1505 1 : slfo->createlogdir_ = 0;
1506 1 : slfo->buffersize_ = 0;
1507 1 : slfo->unicode_ = 0;
1508 1 : slfo->isfileopen_ = 0;
1509 :
1510 1 : fo_file_type( slfo, "file", &filetype );
1511 :
1512 1 : fail_unless( filetype != INITPTR
1513 : , "filetype == INITPTR" );
1514 : }
1515 1 : END_TEST
1516 : /* ------------------------------------------------------------------------- */
1517 1 : START_TEST(test_fo_file_type6)
1518 : {
1519 1 : char* filetype = INITPTR;
1520 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1521 1 : slfo->loggertype_ = ESData;
1522 1 : slfo->overwrite_ = ESTrue;
1523 1 : slfo->withtimestamp_ = 1;
1524 1 : slfo->withlinebreak_ = 1;
1525 1 : slfo->witheventranking_ = 0;
1526 1 : slfo->pididtologfile_ = 1;
1527 1 : slfo->createlogdir_ = 0;
1528 1 : slfo->buffersize_ = 0;
1529 1 : slfo->unicode_ = 0;
1530 1 : slfo->isfileopen_ = 0;
1531 :
1532 1 : fo_file_type( slfo, "file", &filetype );
1533 :
1534 1 : fail_unless( filetype != INITPTR
1535 : , "filetype == INITPTR" );
1536 : }
1537 1 : END_TEST
1538 : /* ------------------------------------------------------------------------- */
1539 1 : START_TEST(test_fo_file_type7)
1540 : {
1541 1 : char* filetype = INITPTR;
1542 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1543 1 : slfo->loggertype_ = ESTxt;
1544 1 : slfo->overwrite_ = ESFile;
1545 1 : slfo->withtimestamp_ = 1;
1546 1 : slfo->withlinebreak_ = 1;
1547 1 : slfo->witheventranking_ = 0;
1548 1 : slfo->pididtologfile_ = 0;
1549 1 : slfo->createlogdir_ = 0;
1550 1 : slfo->buffersize_ = 0;
1551 1 : slfo->unicode_ = 0;
1552 1 : slfo->isfileopen_ = 0;
1553 :
1554 1 : fo_file_type( slfo, "file.txt", &filetype );
1555 :
1556 1 : fail_unless( filetype != INITPTR
1557 : , "filetype == INITPTR" );
1558 : }
1559 1 : END_TEST
1560 : /* ------------------------------------------------------------------------- */
1561 1 : START_TEST(test_fo_file_type8)
1562 : {
1563 1 : char* filetype = INITPTR;
1564 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1565 1 : slfo->loggertype_ = ESHtml;
1566 1 : slfo->overwrite_ = ESFile;
1567 1 : slfo->withtimestamp_ = 1;
1568 1 : slfo->withlinebreak_ = 1;
1569 1 : slfo->witheventranking_ = 0;
1570 1 : slfo->pididtologfile_ = 0;
1571 1 : slfo->createlogdir_ = 0;
1572 1 : slfo->buffersize_ = 0;
1573 1 : slfo->unicode_ = 0;
1574 1 : slfo->isfileopen_ = 0;
1575 :
1576 1 : fo_file_type( slfo, "file.html", &filetype );
1577 :
1578 1 : fail_unless( filetype != INITPTR
1579 : , "filetype == INITPTR" );
1580 : }
1581 1 : END_TEST
1582 : /* ------------------------------------------------------------------------- */
1583 1 : START_TEST(test_fo_file_type9)
1584 : {
1585 1 : char* filetype = INITPTR;
1586 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1587 1 : slfo->loggertype_ = ESData;
1588 1 : slfo->overwrite_ = ESFile;
1589 1 : slfo->withtimestamp_ = 1;
1590 1 : slfo->withlinebreak_ = 1;
1591 1 : slfo->witheventranking_ = 0;
1592 1 : slfo->pididtologfile_ = 0;
1593 1 : slfo->createlogdir_ = 0;
1594 1 : slfo->buffersize_ = 0;
1595 1 : slfo->unicode_ = 0;
1596 1 : slfo->isfileopen_ = 0;
1597 :
1598 1 : fo_file_type( slfo, "file.sth", &filetype );
1599 :
1600 1 : fail_unless( filetype != INITPTR
1601 : , "filetype == INITPTR" );
1602 : }
1603 1 : END_TEST
1604 : /* ------------------------------------------------------------------------- */
1605 1 : START_TEST(test_fo_file_type10)
1606 : {
1607 1 : char* filetype = INITPTR;
1608 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1609 1 : slfo->loggertype_ = ESTxt;
1610 1 : slfo->overwrite_ = ESFile;
1611 1 : slfo->withtimestamp_ = 1;
1612 1 : slfo->withlinebreak_ = 1;
1613 1 : slfo->witheventranking_ = 0;
1614 1 : slfo->pididtologfile_ = 0;
1615 1 : slfo->createlogdir_ = 0;
1616 1 : slfo->buffersize_ = 0;
1617 1 : slfo->unicode_ = 0;
1618 1 : slfo->isfileopen_ = 0;
1619 :
1620 1 : fo_file_type( slfo, "file", &filetype );
1621 :
1622 1 : fail_unless( filetype != INITPTR
1623 : , "filetype == INITPTR" );
1624 : }
1625 1 : END_TEST
1626 : /* ------------------------------------------------------------------------- */
1627 1 : START_TEST(test_fo_file_type11)
1628 : {
1629 1 : char* filetype = INITPTR;
1630 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1631 1 : slfo->loggertype_ = ESHtml;
1632 1 : slfo->overwrite_ = ESFile;
1633 1 : slfo->withtimestamp_ = 1;
1634 1 : slfo->withlinebreak_ = 1;
1635 1 : slfo->witheventranking_ = 0;
1636 1 : slfo->pididtologfile_ = 0;
1637 1 : slfo->createlogdir_ = 0;
1638 1 : slfo->buffersize_ = 0;
1639 1 : slfo->unicode_ = 0;
1640 1 : slfo->isfileopen_ = 0;
1641 :
1642 1 : fo_file_type( slfo, "file", &filetype );
1643 :
1644 1 : fail_unless( filetype != INITPTR
1645 : , "filetype == INITPTR" );
1646 : }
1647 1 : END_TEST
1648 : /* ------------------------------------------------------------------------- */
1649 1 : START_TEST(test_fo_file_type12)
1650 : {
1651 1 : char* filetype = INITPTR;
1652 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1653 1 : slfo->loggertype_ = ESData;
1654 1 : slfo->overwrite_ = ESTrue;
1655 1 : slfo->withtimestamp_ = 1;
1656 1 : slfo->withlinebreak_ = 1;
1657 1 : slfo->witheventranking_ = 0;
1658 1 : slfo->pididtologfile_ = 0;
1659 1 : slfo->createlogdir_ = 0;
1660 1 : slfo->buffersize_ = 0;
1661 1 : slfo->unicode_ = 0;
1662 1 : slfo->isfileopen_ = 0;
1663 :
1664 1 : fo_file_type( slfo, "file", &filetype );
1665 :
1666 1 : fail_unless( filetype != INITPTR
1667 : , "filetype == INITPTR" );
1668 : }
1669 1 : END_TEST
1670 : /* ------------------------------------------------------------------------- */
1671 1 : START_TEST(test_fo_file_type13)
1672 : {
1673 1 : char* filetype = INITPTR;
1674 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1675 1 : slfo->loggertype_ = ESTxt;
1676 1 : slfo->overwrite_ = ESTrue;
1677 1 : slfo->withtimestamp_ = 1;
1678 1 : slfo->withlinebreak_ = 1;
1679 1 : slfo->witheventranking_ = 0;
1680 1 : slfo->pididtologfile_ = 1;
1681 1 : slfo->createlogdir_ = 0;
1682 1 : slfo->buffersize_ = 0;
1683 1 : slfo->unicode_ = 0;
1684 1 : slfo->isfileopen_ = 0;
1685 :
1686 1 : fo_file_type( slfo, "file", &filetype );
1687 :
1688 1 : fail_unless( strcmp(filetype,"") != 0
1689 : , "Result differs from expected [%s]", filetype );
1690 : }
1691 1 : END_TEST
1692 : /* ------------------------------------------------------------------------- */
1693 1 : START_TEST(test_fo_file_type14)
1694 : {
1695 1 : char* filetype = INITPTR;
1696 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1697 1 : slfo->loggertype_ = ESTxt;
1698 1 : slfo->overwrite_ = ESTrue;
1699 1 : slfo->withtimestamp_ = 1;
1700 1 : slfo->withlinebreak_ = 1;
1701 1 : slfo->witheventranking_ = 0;
1702 1 : slfo->pididtologfile_ = 1;
1703 1 : slfo->createlogdir_ = 0;
1704 1 : slfo->buffersize_ = 0;
1705 1 : slfo->unicode_ = 0;
1706 1 : slfo->isfileopen_ = 0;
1707 :
1708 1 : fo_file_type( slfo, "file.txt", &filetype );
1709 :
1710 1 : fail_unless( strcmp(filetype,"") == 0
1711 : , "Result differs from expected [%s]", filetype );
1712 : }
1713 1 : END_TEST
1714 : /* ------------------------------------------------------------------------- */
1715 1 : START_TEST(test_fo_file_type15)
1716 : {
1717 1 : char* filetype = INITPTR;
1718 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1719 1 : slfo->loggertype_ = ESTxt;
1720 1 : slfo->overwrite_ = ESTrue;
1721 1 : slfo->withtimestamp_ = 1;
1722 1 : slfo->withlinebreak_ = 1;
1723 1 : slfo->witheventranking_ = 0;
1724 1 : slfo->pididtologfile_ = 0;
1725 1 : slfo->createlogdir_ = 0;
1726 1 : slfo->buffersize_ = 0;
1727 1 : slfo->unicode_ = 0;
1728 1 : slfo->isfileopen_ = 0;
1729 :
1730 1 : fo_file_type( slfo, "file", &filetype );
1731 :
1732 1 : fail_unless( strcmp(filetype,".txt") == 0
1733 : , "Result differs from expected [%s]", filetype );
1734 : }
1735 1 : END_TEST
1736 : /* ------------------------------------------------------------------------- */
1737 1 : START_TEST(test_fo_file_type16)
1738 : {
1739 1 : char* filetype = INITPTR;
1740 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1741 1 : slfo->loggertype_ = ESTxt;
1742 1 : slfo->overwrite_ = ESTrue;
1743 1 : slfo->withtimestamp_ = 1;
1744 1 : slfo->withlinebreak_ = 1;
1745 1 : slfo->witheventranking_ = 0;
1746 1 : slfo->pididtologfile_ = 0;
1747 1 : slfo->createlogdir_ = 0;
1748 1 : slfo->buffersize_ = 0;
1749 1 : slfo->unicode_ = 0;
1750 1 : slfo->isfileopen_ = 0;
1751 :
1752 1 : fo_file_type( slfo, "file.txt", &filetype );
1753 :
1754 1 : fail_unless( strcmp(filetype,"") == 0
1755 : , "Result differs from expected [%s]", filetype );
1756 : }
1757 1 : END_TEST
1758 : /* ------------------------------------------------------------------------- */
1759 1 : START_TEST(test_fo_file_type17)
1760 : {
1761 1 : char* filetype = INITPTR;
1762 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1763 1 : slfo->loggertype_ = ESHtml;
1764 1 : slfo->overwrite_ = ESTrue;
1765 1 : slfo->withtimestamp_ = 1;
1766 1 : slfo->withlinebreak_ = 1;
1767 1 : slfo->witheventranking_ = 0;
1768 1 : slfo->pididtologfile_ = 1;
1769 1 : slfo->createlogdir_ = 0;
1770 1 : slfo->buffersize_ = 0;
1771 1 : slfo->unicode_ = 0;
1772 1 : slfo->isfileopen_ = 0;
1773 :
1774 1 : fo_file_type( slfo, "file", &filetype );
1775 :
1776 1 : fail_unless( strcmp(filetype,"") != 0
1777 : , "Result differs from expected [%s]", filetype );
1778 : }
1779 1 : END_TEST
1780 : /* ------------------------------------------------------------------------- */
1781 1 : START_TEST(test_fo_file_type18)
1782 : {
1783 1 : char* filetype = INITPTR;
1784 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1785 1 : slfo->loggertype_ = ESHtml;
1786 1 : slfo->overwrite_ = ESTrue;
1787 1 : slfo->withtimestamp_ = 1;
1788 1 : slfo->withlinebreak_ = 1;
1789 1 : slfo->witheventranking_ = 0;
1790 1 : slfo->pididtologfile_ = 1;
1791 1 : slfo->createlogdir_ = 0;
1792 1 : slfo->buffersize_ = 0;
1793 1 : slfo->unicode_ = 0;
1794 1 : slfo->isfileopen_ = 0;
1795 :
1796 1 : fo_file_type( slfo, "file.html", &filetype );
1797 :
1798 1 : fail_unless( strcmp(filetype,"") == 0
1799 : , "Result differs from expected [%s]", filetype );
1800 : }
1801 1 : END_TEST
1802 : /* ------------------------------------------------------------------------- */
1803 1 : START_TEST(test_fo_file_type19)
1804 : {
1805 1 : char* filetype = INITPTR;
1806 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1807 1 : slfo->loggertype_ = ESHtml;
1808 1 : slfo->overwrite_ = ESTrue;
1809 1 : slfo->withtimestamp_ = 1;
1810 1 : slfo->withlinebreak_ = 1;
1811 1 : slfo->witheventranking_ = 0;
1812 1 : slfo->pididtologfile_ = 0;
1813 1 : slfo->createlogdir_ = 0;
1814 1 : slfo->buffersize_ = 0;
1815 1 : slfo->unicode_ = 0;
1816 1 : slfo->isfileopen_ = 0;
1817 :
1818 1 : fo_file_type( slfo, "file", &filetype );
1819 :
1820 1 : fail_unless( strcmp(filetype,".html") == 0
1821 : , "Result differs from expected [%s]", filetype );
1822 : }
1823 1 : END_TEST
1824 : /* ------------------------------------------------------------------------- */
1825 1 : START_TEST(test_fo_file_type20)
1826 : {
1827 1 : char* filetype = INITPTR;
1828 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1829 1 : slfo->loggertype_ = ESHtml;
1830 1 : slfo->overwrite_ = ESTrue;
1831 1 : slfo->withtimestamp_ = 1;
1832 1 : slfo->withlinebreak_ = 1;
1833 1 : slfo->witheventranking_ = 0;
1834 1 : slfo->pididtologfile_ = 0;
1835 1 : slfo->createlogdir_ = 0;
1836 1 : slfo->buffersize_ = 0;
1837 1 : slfo->unicode_ = 0;
1838 1 : slfo->isfileopen_ = 0;
1839 :
1840 1 : fo_file_type( slfo, "file.html", &filetype );
1841 :
1842 1 : fail_unless( strcmp(filetype,"") == 0
1843 : , "Result differs from expected [%s]", filetype );
1844 : }
1845 1 : END_TEST
1846 : /* ------------------------------------------------------------------------- */
1847 1 : START_TEST(test_fo_file_type21)
1848 : {
1849 1 : char* filetype = INITPTR;
1850 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1851 1 : slfo->loggertype_ = ESData;
1852 1 : slfo->overwrite_ = ESTrue;
1853 1 : slfo->withtimestamp_ = 1;
1854 1 : slfo->withlinebreak_ = 1;
1855 1 : slfo->witheventranking_ = 0;
1856 1 : slfo->pididtologfile_ = 1;
1857 1 : slfo->createlogdir_ = 0;
1858 1 : slfo->buffersize_ = 0;
1859 1 : slfo->unicode_ = 0;
1860 1 : slfo->isfileopen_ = 0;
1861 :
1862 1 : fo_file_type( slfo, "file", &filetype );
1863 :
1864 1 : fail_unless( strcmp(filetype,"") != 0
1865 : , "Result differs from expected [%s]", filetype );
1866 : }
1867 1 : END_TEST
1868 : /* ------------------------------------------------------------------------- */
1869 1 : START_TEST(test_fo_file_type22)
1870 : {
1871 1 : char* filetype = INITPTR;
1872 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1873 1 : slfo->loggertype_ = ESData;
1874 1 : slfo->overwrite_ = ESTrue;
1875 1 : slfo->withtimestamp_ = 1;
1876 1 : slfo->withlinebreak_ = 1;
1877 1 : slfo->witheventranking_ = 0;
1878 1 : slfo->pididtologfile_ = 1;
1879 1 : slfo->createlogdir_ = 0;
1880 1 : slfo->buffersize_ = 0;
1881 1 : slfo->unicode_ = 0;
1882 1 : slfo->isfileopen_ = 0;
1883 :
1884 1 : fo_file_type( slfo, "file.sth", &filetype );
1885 :
1886 1 : fail_unless( strcmp(filetype,"") == 0
1887 : , "Result differs from expected [%s]", filetype );
1888 : }
1889 1 : END_TEST
1890 : /* ------------------------------------------------------------------------- */
1891 1 : START_TEST(test_fo_file_type23)
1892 : {
1893 1 : char* filetype = INITPTR;
1894 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1895 1 : slfo->loggertype_ = ESData;
1896 1 : slfo->overwrite_ = ESTrue;
1897 1 : slfo->withtimestamp_ = 1;
1898 1 : slfo->withlinebreak_ = 1;
1899 1 : slfo->witheventranking_ = 0;
1900 1 : slfo->pididtologfile_ = 0;
1901 1 : slfo->createlogdir_ = 0;
1902 1 : slfo->buffersize_ = 0;
1903 1 : slfo->unicode_ = 0;
1904 1 : slfo->isfileopen_ = 0;
1905 :
1906 1 : fo_file_type( slfo, "file", &filetype );
1907 :
1908 1 : fail_unless( strcmp(filetype,"") == 0
1909 : , "Result differs from expected [%s]", filetype );
1910 : }
1911 1 : END_TEST
1912 : /* ------------------------------------------------------------------------- */
1913 1 : START_TEST(test_fo_file_type24)
1914 : {
1915 1 : char* filetype = INITPTR;
1916 1 : MinLoggerFileOutput* slfo = NEW(MinLoggerFileOutput);
1917 1 : slfo->loggertype_ = ESData;
1918 1 : slfo->overwrite_ = ESTrue;
1919 1 : slfo->withtimestamp_ = 1;
1920 1 : slfo->withlinebreak_ = 1;
1921 1 : slfo->witheventranking_ = 0;
1922 1 : slfo->pididtologfile_ = 0;
1923 1 : slfo->createlogdir_ = 0;
1924 1 : slfo->buffersize_ = 0;
1925 1 : slfo->unicode_ = 0;
1926 1 : slfo->isfileopen_ = 0;
1927 :
1928 1 : fo_file_type( slfo, "file.sth", &filetype );
1929 :
1930 1 : fail_unless( strcmp(filetype,"") == 0
1931 : , "Result differs from expected [%s]", filetype );
1932 : }
1933 1 : END_TEST
1934 : /* ------------------------------------------------------------------------- */
1935 1 : START_TEST(test_so_create)
1936 : {
1937 1 : MinLoggerSyslogOutput* sxso = INITPTR;
1938 :
1939 1 : sxso = so_create( NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0 );
1940 :
1941 1 : fail_unless( sxso != INITPTR
1942 : , "Syslog Output: sxso == INITPTR" );
1943 : }
1944 1 : END_TEST
1945 : /* ------------------------------------------------------------------------- */
1946 1 : START_TEST(test_so_destroy)
1947 : {
1948 1 : MinLoggerSyslogOutput* sxso = INITPTR;
1949 1 : so_destroy(&sxso);
1950 :
1951 1 : fail_unless( sxso == INITPTR
1952 : , "SysLog Output: sxso != INITPTR after destruction" );
1953 : }
1954 1 : END_TEST
1955 : /* ------------------------------------------------------------------------- */
1956 1 : START_TEST(test_so_destroy2)
1957 : {
1958 1 : MinLoggerSyslogOutput* sxso = INITPTR;
1959 :
1960 1 : sxso = so_create( NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0 );
1961 1 : so_destroy(&sxso);
1962 :
1963 1 : fail_unless( sxso == INITPTR
1964 : , "SysLog Output: sxso != INITPTR after destruction" );
1965 : }
1966 1 : END_TEST
1967 : /* ------------------------------------------------------------------------- */
1968 1 : START_TEST(test_so_write)
1969 : {
1970 1 : MinLoggerSyslogOutput* sxso = INITPTR;
1971 1 : TSChar name[] = "SYSLOG TEST";
1972 1 : TSChar data[] = "LOGGER UNIT TESTING: Syslog Output message";
1973 :
1974 1 : sxso = so_create( NULL, name, 0, 0, 0, 0, 0, 0, 0, 1000, 0 );
1975 1 : fail_unless( sxso != INITPTR
1976 : , "Syslog Output: sxso == INITPTR" );
1977 :
1978 1 : so_write( sxso, 0, 0, 0, data );
1979 : }
1980 1 : END_TEST
1981 : /* ------------------------------------------------------------------------- */
1982 : /* ========================== FUNCTIONS ==================================== */
1983 : /* ------------------------------------------------------------------------- */
1984 : Suite* min_logger_file_output_suite()
1985 116 : {
1986 116 : Suite * s = suite_create ("min_logger_file_output");
1987 :
1988 : /* Core test case */
1989 116 : TCase *tc_core = tcase_create ("Core");
1990 :
1991 : /* fo_create */
1992 116 : tcase_add_test (tc_core, test_fo_create );
1993 116 : tcase_add_test (tc_core, test_fo_create2 );
1994 116 : tcase_add_test (tc_core, test_fo_create3 );
1995 116 : tcase_add_test (tc_core, test_fo_create4 );
1996 116 : tcase_add_test (tc_core, test_fo_create5 );
1997 116 : tcase_add_test (tc_core, test_fo_create6 );
1998 116 : tcase_add_test (tc_core, test_fo_create7 );
1999 116 : tcase_add_test (tc_core, test_fo_create8 );
2000 116 : tcase_add_test (tc_core, test_fo_create9 );
2001 116 : tcase_add_test (tc_core, test_fo_create10 );
2002 116 : tcase_add_test (tc_core, test_fo_create11 );
2003 116 : tcase_add_test (tc_core, test_fo_create12 );
2004 116 : tcase_add_test (tc_core, test_fo_create13 );
2005 116 : tcase_add_test (tc_core, test_fo_create14 );
2006 116 : tcase_add_test (tc_core, test_fo_create15 );
2007 116 : tcase_add_test (tc_core, test_fo_create16 );
2008 116 : tcase_add_test (tc_core, test_fo_create17 );
2009 116 : tcase_add_test (tc_core, test_fo_create18 );
2010 116 : tcase_add_test (tc_core, test_fo_create19 );
2011 116 : tcase_add_test (tc_core, test_fo_create20 );
2012 116 : tcase_add_test (tc_core, test_fo_create21 );
2013 116 : tcase_add_test (tc_core, test_fo_create22 );
2014 116 : tcase_add_test (tc_core, test_fo_create23 );
2015 116 : tcase_add_test (tc_core, test_fo_create24 );
2016 116 : tcase_add_test (tc_core, test_fo_create25 );
2017 116 : tcase_add_test (tc_core, test_fo_create26 );
2018 116 : tcase_add_test (tc_core, test_fo_create27 );
2019 116 : tcase_add_test (tc_core, test_fo_create28 );
2020 116 : tcase_add_test (tc_core, test_fo_create29 );
2021 116 : tcase_add_test (tc_core, test_fo_create30 );
2022 116 : tcase_add_test (tc_core, test_fo_create31 );
2023 :
2024 : /* fo_destroy */
2025 116 : tcase_add_test (tc_core, test_fo_destroy );
2026 116 : tcase_add_test (tc_core, test_fo_destroy2 );
2027 :
2028 : /* fo_write */
2029 : /* Hard to be tested */
2030 :
2031 : /* fo_create_directory */
2032 : /* Hard to be tested */
2033 :
2034 : /* fo_open_existing_file */
2035 116 : tcase_add_test (tc_core, test_fo_open_existing_file_with_txt_type_no_pid );
2036 116 : tcase_add_test (tc_core, test_fo_open_existing_file_with_html_type_no_pid );
2037 116 : tcase_add_test (tc_core, test_fo_open_existing_file_with_txt_type_and_pid );
2038 116 : tcase_add_test (tc_core, test_fo_open_existing_file_with_html_type_and_pid );
2039 116 : tcase_add_test (tc_core, test_fo_open_existing_file_with_filetype_and_no_pid );
2040 :
2041 116 : tcase_add_test (tc_core, test_fo_open_existing_file_and_file_handle );
2042 116 : tcase_add_test (tc_core, test_fo_open_existing_file_and_file_open_flag );
2043 116 : tcase_add_test (tc_core, test_fo_open_existing_file_without_last_slash );
2044 :
2045 : /* fo_create_new_file */
2046 116 : tcase_add_test (tc_core, test_fo_create_new_file_with_txt_type_and_no_pid );
2047 116 : tcase_add_test (tc_core, test_fo_create_new_file_with_html_type_and_no_pid );
2048 116 : tcase_add_test (tc_core, test_fo_create_new_file_with_txt_type_and_pid );
2049 116 : tcase_add_test (tc_core, test_fo_create_new_file_with_html_type_and_pid );
2050 :
2051 116 : tcase_add_test (tc_core, test_fo_create_new_file_and_file_handle );
2052 116 : tcase_add_test (tc_core, test_fo_create_new_file_and_file_open_flag );
2053 116 : tcase_add_test (tc_core, test_fo_create_new_file_without_last_slash );
2054 :
2055 116 : tcase_add_test (tc_core, test_fo_create_new_file_fullname_txt_and_pid );
2056 116 : tcase_add_test (tc_core, test_fo_create_new_file_fullname_html_and_pid );
2057 116 : tcase_add_test (tc_core, test_fo_create_new_file_name_without_txt_pid_use );
2058 116 : tcase_add_test (tc_core, test_fo_create_new_file_name_without_html_pid_use );
2059 :
2060 : /* fo_event_ranking */
2061 116 : tcase_add_test (tc_core, test_fo_event_ranking);
2062 116 : tcase_add_test (tc_core, test_fo_event_ranking2);
2063 116 : tcase_add_test (tc_core, test_fo_event_ranking3);
2064 :
2065 : /* fo_add_timestamp_to_data */
2066 116 : tcase_add_test (tc_core, test_fo_add_timestamp_to_data );
2067 :
2068 : /* fo_test_file_with_pid */
2069 116 : tcase_add_test (tc_core, test_fo_test_file_with_pid);
2070 116 : tcase_add_test (tc_core, test_fo_test_file_with_pid2);
2071 116 : tcase_add_test (tc_core, test_fo_test_file_with_pid3);
2072 116 : tcase_add_test (tc_core, test_fo_test_file_with_pid4);
2073 116 : tcase_add_test (tc_core, test_fo_test_file_with_pid5);
2074 116 : tcase_add_test (tc_core, test_fo_test_file_with_pid6);
2075 116 : tcase_add_test (tc_core, test_fo_test_file_with_pid7);
2076 :
2077 : /* fo_file_type */
2078 116 : tcase_add_test (tc_core, test_fo_file_type);
2079 116 : tcase_add_test (tc_core, test_fo_file_type2);
2080 116 : tcase_add_test (tc_core, test_fo_file_type3);
2081 116 : tcase_add_test (tc_core, test_fo_file_type4);
2082 116 : tcase_add_test (tc_core, test_fo_file_type5);
2083 116 : tcase_add_test (tc_core, test_fo_file_type6);
2084 116 : tcase_add_test (tc_core, test_fo_file_type7);
2085 116 : tcase_add_test (tc_core, test_fo_file_type8);
2086 116 : tcase_add_test (tc_core, test_fo_file_type9);
2087 116 : tcase_add_test (tc_core, test_fo_file_type10);
2088 116 : tcase_add_test (tc_core, test_fo_file_type11);
2089 116 : tcase_add_test (tc_core, test_fo_file_type12);
2090 116 : tcase_add_test (tc_core, test_fo_file_type13);
2091 116 : tcase_add_test (tc_core, test_fo_file_type14);
2092 116 : tcase_add_test (tc_core, test_fo_file_type15);
2093 116 : tcase_add_test (tc_core, test_fo_file_type16);
2094 116 : tcase_add_test (tc_core, test_fo_file_type17);
2095 116 : tcase_add_test (tc_core, test_fo_file_type18);
2096 116 : tcase_add_test (tc_core, test_fo_file_type19);
2097 116 : tcase_add_test (tc_core, test_fo_file_type20);
2098 116 : tcase_add_test (tc_core, test_fo_file_type21);
2099 116 : tcase_add_test (tc_core, test_fo_file_type22);
2100 116 : tcase_add_test (tc_core, test_fo_file_type23);
2101 116 : tcase_add_test (tc_core, test_fo_file_type24);
2102 :
2103 : /* so_create */
2104 116 : tcase_add_test (tc_core, test_so_create);
2105 :
2106 : /* so_destroy */
2107 116 : tcase_add_test (tc_core, test_so_destroy);
2108 116 : tcase_add_test (tc_core, test_so_destroy2);
2109 :
2110 : /* so_write */
2111 116 : tcase_add_test (tc_core, test_so_write);
2112 :
2113 116 : suite_add_tcase (s, tc_core);
2114 :
2115 116 : return s;
2116 : }
2117 : /* ------------------------------------------------------------------------- */
2118 : int min_logger_file_output_tests()
2119 0 : {
2120 0 : int number_failed = 0;
2121 0 : Suite * s = min_logger_file_output_suite ();
2122 0 : SRunner * sr = srunner_create (s);
2123 0 : srunner_set_fork_status (sr, CK_NOFORK);
2124 0 : srunner_run_all(sr, CK_NORMAL);
2125 0 : number_failed = srunner_ntests_failed(sr);
2126 0 : srunner_free(sr);
2127 0 : return number_failed;
2128 : }
2129 : /* ------------------------------------------------------------------------- */
2130 : /* End of file */
|