044005c9ef9c2481e1b867e0d3ca2232c2873110
4 * @brief Test module for automatic testing
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26 #include <pluto/constants.h>
27 #include <pluto/defs.h>
30 #include "linked_list.h"
39 * @brief Test function to test the linked list class
41 static status_t
test_linked_list(private_tester_t
* this){
42 fprintf(this->output
,"Test linked list class...\n");
43 linked_list_t
* linked_list_create();
48 static status_t
test_all(tester_t
*tester
)
50 private_tester_t
*this =(private_tester_t
*) tester
;
54 fprintf(this->output
,"Start testing\n");
56 if (test_linked_list(this) != SUCCESS
){ tests_failed
++; } test_count
++;
58 fprintf(this->output
,"End testing. %d tests failed of %d tests\n",tests_failed
,test_count
);
63 static status_t
destroy(tester_t
*this)
70 tester_t
*tester_create(FILE *output
)
72 private_tester_t
*this = alloc_thing(private_tester_t
, "private_tester_t");
74 this->tester
.destroy
= destroy
;
75 this->tester
.test_all
= test_all
;
77 this->output
= output
;
79 return &(this->tester
);