- tests are now performed in its own main tests.c

-
This commit is contained in:
Jan Hutter
2005-11-07 08:34:40 +00:00
parent 8ccd0b01f9
commit fd9cabd4e6
13 changed files with 128 additions and 103 deletions
+1 -1
View File
@@ -21,7 +21,7 @@
*/
#include "event_queue_test.h"
#include "../tester.h"
#include "../event_queue.h"
-5
View File
@@ -34,9 +34,4 @@
*/
void test_event_queue(tester_t *tester);
/**
* Test for event_queue_t
*/
test_t event_queue_test = {test_event_queue,"Event-Queue Test"};
#endif /*EVENT_QUEUE_TEST_H_*/
+3 -2
View File
@@ -21,13 +21,14 @@
*/
//#include <stdlib.h>
#include <stdlib.h>
#include <freeswan.h>
#include <pluto/constants.h>
#include <pluto/defs.h>
#include <pthread.h>
#include <unistd.h>
#include "job_queue_test.h"
#include "../tester.h"
#include "../job_queue.h"
@@ -130,7 +131,7 @@ void test_job_queue(tester_t *tester)
}
/* the job-queue has to be empty now! */
/* the job-queue has to have disered_value count entries! */
tester->assert_true(tester,(job_queue->get_count(job_queue,&value) == SUCCESS), "get count call check");
tester->assert_true(tester,(value == desired_value), "get count value check");
tester->assert_true(tester,(job_queue->destroy(job_queue) == SUCCESS), "destroy call check");
-5
View File
@@ -35,9 +35,4 @@
*/
void test_job_queue(tester_t *tester);
/**
* Test 1 for linked_list_t
*/
test_t job_queue_test1 = {test_job_queue,"Job-Queue Test1"};
#endif /*JOB_QUEUE_TEST_H_*/
-16
View File
@@ -65,20 +65,4 @@ void test_linked_list_iterator(tester_t *tester);
*/
void test_linked_list_insert_and_remove(tester_t *tester);
/**
* Test for linked_list_t
*/
test_t linked_list_test = {test_linked_list,"Linked List"};
/**
* Test for linked_list_t with iterator
*/
test_t linked_list_iterator_test = {test_linked_list_iterator,"Linked List Iterator"};
/**
* Test for linked_list_t insert and remove
*/
test_t linked_list_insert_and_remove_test = {test_linked_list_insert_and_remove,"Linked List Insert and remove"};
#endif /*LINKED_LIST_TEST_H_*/
+2 -1
View File
@@ -22,6 +22,8 @@
#include <stdlib.h>
#include <string.h>
#include "socket_test.h"
#include "../tester.h"
#include "../socket.h"
@@ -47,4 +49,3 @@ void test_socket(tester_t *tester)
tester->assert_false(tester, strcmp(test_string, pkt->data.ptr), "packet exchange");
}
+2 -6
View File
@@ -23,6 +23,8 @@
#ifndef SOCKET_TEST_H_
#define SOCKET_TEST_H_
#include "../tester.h"
/**
* @brief Test function for the type socket_t
*
@@ -30,11 +32,5 @@
*/
void test_socket(tester_t *tester);
/**
* Test for socket_t
*/
test_t socket_test = {test_socket,"Socket"};
#endif /*SOCKET_TEST_H_*/
-48
View File
@@ -1,48 +0,0 @@
/**
* @file tests.h
*
* @brief Lists all the tests to be processed by the tester object
*
* New tests have to be added here!
*
*/
/*
* Copyright (C) 2005 Jan Hutter, Martin Willi
* Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
#ifndef TESTS_H_
#define TESTS_H_
#include "../tester.h"
#include "linked_list_test.h"
#include "thread_pool_test.h"
#include "job_queue_test.h"
#include "event_queue_test.h"
/**
* @brief these tests are getting performed by the tester
*/
test_t *tests[] ={
&linked_list_test,
&linked_list_iterator_test,
&linked_list_insert_and_remove_test,
&thread_pool_test,
&job_queue_test1,
&event_queue_test,
NULL
};
#endif /*TESTS_H_*/
+2 -1
View File
@@ -21,6 +21,8 @@
*/
#include <stdlib.h>
#include "thread_pool_test.h"
#include "../tester.h"
#include "../thread_pool.h"
@@ -37,4 +39,3 @@ void test_thread_pool(tester_t *tester)
tester->assert_true(tester, (desired_pool_size == pool_size), "thread creation");
tester->assert_true(tester, (pool->destroy(pool) == SUCCESS), "threadpool destruction");
}
+2 -5
View File
@@ -23,6 +23,8 @@
#ifndef THREAD_POOL_TEST_H_
#define THREAD_POOL_TEST_H_
#include "../tester.h"
/**
* @brief Test function for the type thread_pool_t
*
@@ -30,9 +32,4 @@
*/
void test_thread_pool(tester_t *tester);
/**
* Test for thread_pool_t
*/
test_t thread_pool_test = {test_thread_pool,"Thread Pool"};
#endif /*THREAD_POOL_TEST_H_*/