created protected_tester_t for testcases
This commit is contained in:
parent
f4d8999cc1
commit
51d56047d8
|
@ -27,7 +27,7 @@
|
|||
#include <utils/allocator.h>
|
||||
#include <daemon.h>
|
||||
|
||||
void test_aes_cbc_crypter(tester_t *tester)
|
||||
void test_aes_cbc_crypter(protected_tester_t *tester)
|
||||
{
|
||||
/*
|
||||
* Test 1 of RFC3602
|
||||
|
|
|
@ -33,6 +33,6 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_aes_cbc_crypter(tester_t *tester);
|
||||
void test_aes_cbc_crypter(protected_tester_t *tester);
|
||||
|
||||
#endif //_AES_CBC_CRYPTER_TEST_H_
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
/*
|
||||
* described in Header-File
|
||||
*/
|
||||
void test_diffie_hellman(tester_t *tester)
|
||||
void test_diffie_hellman(protected_tester_t *tester)
|
||||
{
|
||||
diffie_hellman_t *my_diffie_hellman, *other_diffie_hellman;
|
||||
logger_t *logger;
|
||||
|
|
|
@ -32,6 +32,6 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_diffie_hellman(tester_t *tester);
|
||||
void test_diffie_hellman(protected_tester_t *tester);
|
||||
|
||||
#endif /*DIFFIE_HELLMAN_TEST_H_*/
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
/*
|
||||
* described in Header-File
|
||||
*/
|
||||
void test_encryption_payload(tester_t *tester)
|
||||
void test_encryption_payload(protected_tester_t *tester)
|
||||
{
|
||||
encryption_payload_t *encryption_payload;
|
||||
nonce_payload_t *nonce_payload;
|
||||
|
|
|
@ -32,6 +32,6 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_encryption_payload(tester_t *tester);
|
||||
void test_encryption_payload(protected_tester_t *tester);
|
||||
|
||||
#endif /*ENCRYPTION_PAYLOAD_TEST_H_*/
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
typedef struct event_queue_test_s event_queue_test_t;
|
||||
|
||||
struct event_queue_test_s{
|
||||
tester_t *tester;
|
||||
protected_tester_t *tester;
|
||||
event_queue_t *event_queue;
|
||||
|
||||
/**
|
||||
|
@ -88,7 +88,7 @@ static void event_queue_insert_thread(event_queue_test_t * testinfos)
|
|||
}
|
||||
|
||||
|
||||
void test_event_queue(tester_t *tester)
|
||||
void test_event_queue(protected_tester_t *tester)
|
||||
{
|
||||
event_queue_t * event_queue = event_queue_create();
|
||||
event_queue_test_t testinfos;
|
||||
|
|
|
@ -34,6 +34,6 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_event_queue(tester_t *tester);
|
||||
void test_event_queue(protected_tester_t *tester);
|
||||
|
||||
#endif /*EVENT_QUEUE_TEST_H_*/
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
/*
|
||||
* Described in Header
|
||||
*/
|
||||
void test_generator_with_header_payload(tester_t *tester)
|
||||
void test_generator_with_header_payload(protected_tester_t *tester)
|
||||
{
|
||||
generator_t *generator;
|
||||
ike_header_t *header_data;
|
||||
|
@ -136,7 +136,7 @@ void test_generator_with_header_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in header
|
||||
*/
|
||||
void test_generator_with_transform_attribute(tester_t *tester)
|
||||
void test_generator_with_transform_attribute(protected_tester_t *tester)
|
||||
{
|
||||
generator_t *generator;
|
||||
transform_attribute_t *attribute;
|
||||
|
@ -232,7 +232,7 @@ void test_generator_with_transform_attribute(tester_t *tester)
|
|||
/*
|
||||
* Described in header
|
||||
*/
|
||||
void test_generator_with_transform_substructure(tester_t *tester)
|
||||
void test_generator_with_transform_substructure(protected_tester_t *tester)
|
||||
{
|
||||
generator_t *generator;
|
||||
transform_attribute_t *attribute1, *attribute2;
|
||||
|
@ -302,7 +302,7 @@ void test_generator_with_transform_substructure(tester_t *tester)
|
|||
/*
|
||||
* Described in header
|
||||
*/
|
||||
void test_generator_with_proposal_substructure(tester_t *tester)
|
||||
void test_generator_with_proposal_substructure(protected_tester_t *tester)
|
||||
{
|
||||
generator_t *generator;
|
||||
transform_attribute_t *attribute1, *attribute2, *attribute3;
|
||||
|
@ -417,7 +417,7 @@ void test_generator_with_proposal_substructure(tester_t *tester)
|
|||
/*
|
||||
* Described in header
|
||||
*/
|
||||
void test_generator_with_sa_payload(tester_t *tester)
|
||||
void test_generator_with_sa_payload(protected_tester_t *tester)
|
||||
{
|
||||
generator_t *generator;
|
||||
transform_attribute_t *attribute1, *attribute2, *attribute3;
|
||||
|
@ -786,7 +786,7 @@ void test_generator_with_sa_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in header
|
||||
*/
|
||||
void test_generator_with_ke_payload(tester_t *tester)
|
||||
void test_generator_with_ke_payload(protected_tester_t *tester)
|
||||
{
|
||||
generator_t *generator;
|
||||
ke_payload_t *ke_payload;
|
||||
|
@ -841,7 +841,7 @@ void test_generator_with_ke_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in header
|
||||
*/
|
||||
void test_generator_with_notify_payload(tester_t *tester)
|
||||
void test_generator_with_notify_payload(protected_tester_t *tester)
|
||||
{
|
||||
generator_t *generator;
|
||||
notify_payload_t *notify_payload;
|
||||
|
@ -901,7 +901,7 @@ void test_generator_with_notify_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in header
|
||||
*/
|
||||
void test_generator_with_nonce_payload(tester_t *tester)
|
||||
void test_generator_with_nonce_payload(protected_tester_t *tester)
|
||||
{
|
||||
generator_t *generator;
|
||||
nonce_payload_t *nonce_payload;
|
||||
|
@ -955,7 +955,7 @@ void test_generator_with_nonce_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in header.
|
||||
*/
|
||||
void test_generator_with_id_payload(tester_t *tester)
|
||||
void test_generator_with_id_payload(protected_tester_t *tester)
|
||||
{
|
||||
generator_t *generator;
|
||||
id_payload_t *id_payload;
|
||||
|
@ -1008,7 +1008,7 @@ void test_generator_with_id_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in header.
|
||||
*/
|
||||
void test_generator_with_auth_payload(tester_t *tester)
|
||||
void test_generator_with_auth_payload(protected_tester_t *tester)
|
||||
{
|
||||
generator_t *generator;
|
||||
auth_payload_t *auth_payload;
|
||||
|
@ -1061,7 +1061,7 @@ void test_generator_with_auth_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in header.
|
||||
*/
|
||||
void test_generator_with_ts_payload(tester_t *tester)
|
||||
void test_generator_with_ts_payload(protected_tester_t *tester)
|
||||
{
|
||||
generator_t *generator;
|
||||
ts_payload_t *ts_payload;
|
||||
|
@ -1145,7 +1145,7 @@ void test_generator_with_ts_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in header.
|
||||
*/
|
||||
void test_generator_with_cert_payload(tester_t *tester)
|
||||
void test_generator_with_cert_payload(protected_tester_t *tester)
|
||||
{
|
||||
generator_t *generator;
|
||||
cert_payload_t *cert_payload;
|
||||
|
@ -1197,7 +1197,7 @@ void test_generator_with_cert_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in header.
|
||||
*/
|
||||
void test_generator_with_certreq_payload(tester_t *tester)
|
||||
void test_generator_with_certreq_payload(protected_tester_t *tester)
|
||||
{
|
||||
generator_t *generator;
|
||||
certreq_payload_t *certreq_payload;
|
||||
|
@ -1249,7 +1249,7 @@ void test_generator_with_certreq_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in header.
|
||||
*/
|
||||
void test_generator_with_delete_payload(tester_t *tester)
|
||||
void test_generator_with_delete_payload(protected_tester_t *tester)
|
||||
{
|
||||
generator_t *generator;
|
||||
delete_payload_t *delete_payload;
|
||||
|
@ -1303,7 +1303,7 @@ void test_generator_with_delete_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in header.
|
||||
*/
|
||||
void test_generator_with_vendor_id_payload(tester_t *tester)
|
||||
void test_generator_with_vendor_id_payload(protected_tester_t *tester)
|
||||
{
|
||||
generator_t *generator;
|
||||
vendor_id_payload_t *vendor_id_payload;
|
||||
|
@ -1352,7 +1352,7 @@ void test_generator_with_vendor_id_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in header
|
||||
*/
|
||||
void test_generator_with_cp_payload(tester_t *tester)
|
||||
void test_generator_with_cp_payload(protected_tester_t *tester)
|
||||
{
|
||||
generator_t *generator;
|
||||
configuration_attribute_t *attribute1, *attribute2;
|
||||
|
@ -1426,7 +1426,7 @@ void test_generator_with_cp_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in header.
|
||||
*/
|
||||
void test_generator_with_eap_payload(tester_t *tester)
|
||||
void test_generator_with_eap_payload(protected_tester_t *tester)
|
||||
{
|
||||
generator_t *generator;
|
||||
eap_payload_t *eap_payload;
|
||||
|
|
|
@ -28,156 +28,156 @@
|
|||
/**
|
||||
* @brief Test function used to test the generator with header payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_generator_with_header_payload(tester_t *tester);
|
||||
void test_generator_with_header_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the generator with transform attribute payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_generator_with_transform_attribute(tester_t *tester);
|
||||
void test_generator_with_transform_attribute(protected_tester_t *tester);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the generator with transform substructure payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_generator_with_transform_substructure(tester_t *tester);
|
||||
void test_generator_with_transform_substructure(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the generator with proposal substructure payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_generator_with_proposal_substructure(tester_t *tester);
|
||||
void test_generator_with_proposal_substructure(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the generator with SA payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_generator_with_sa_payload(tester_t *tester);
|
||||
void test_generator_with_sa_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the generator with KE payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_generator_with_ke_payload(tester_t *tester);
|
||||
void test_generator_with_ke_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the generator with Notify payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_generator_with_notify_payload(tester_t *tester);
|
||||
void test_generator_with_notify_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the generator with Nonce payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_generator_with_nonce_payload(tester_t *tester);
|
||||
void test_generator_with_nonce_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the generator with ID payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_generator_with_id_payload(tester_t *tester);
|
||||
void test_generator_with_id_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the generator with AUTH payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_generator_with_auth_payload(tester_t *tester);
|
||||
void test_generator_with_auth_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the generator with TS payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_generator_with_ts_payload(tester_t *tester);
|
||||
void test_generator_with_ts_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the generator with CERT payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_generator_with_cert_payload(tester_t *tester);
|
||||
void test_generator_with_cert_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the generator with CERTREQ payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_generator_with_certreq_payload(tester_t *tester);
|
||||
void test_generator_with_certreq_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the generator with DELETE payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_generator_with_delete_payload(tester_t *tester);
|
||||
void test_generator_with_delete_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the generator with VENDOR ID payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_generator_with_vendor_id_payload(tester_t *tester);
|
||||
void test_generator_with_vendor_id_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the generator with CP payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_generator_with_cp_payload(tester_t *tester);
|
||||
void test_generator_with_cp_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the generator with EAP payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_generator_with_eap_payload(tester_t *tester);
|
||||
void test_generator_with_eap_payload(protected_tester_t *tester);
|
||||
|
||||
|
||||
#endif /*GENERATOR_TEST_H_*/
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
/*
|
||||
* described in Header-File
|
||||
*/
|
||||
void test_md5_hasher(tester_t *tester)
|
||||
void test_md5_hasher(protected_tester_t *tester)
|
||||
{
|
||||
/*
|
||||
* Test vectors from RFC1321:
|
||||
|
@ -96,7 +96,7 @@ void test_md5_hasher(tester_t *tester)
|
|||
/*
|
||||
* described in Header-File
|
||||
*/
|
||||
void test_sha1_hasher(tester_t *tester)
|
||||
void test_sha1_hasher(protected_tester_t *tester)
|
||||
{
|
||||
/*
|
||||
* Test Vectors (from FIPS PUB 180-1)
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_sha1_hasher(tester_t *tester);
|
||||
void test_sha1_hasher(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the Md5-hasher functionality.
|
||||
|
@ -44,6 +44,6 @@ void test_sha1_hasher(tester_t *tester);
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_md5_hasher(tester_t *tester);
|
||||
void test_md5_hasher(protected_tester_t *tester);
|
||||
|
||||
#endif /*HASHER_TEST_H_*/
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
/*
|
||||
* Described in header.
|
||||
*/
|
||||
void test_hmac_md5_signer(tester_t *tester)
|
||||
void test_hmac_md5_signer(protected_tester_t *tester)
|
||||
{
|
||||
/* Test cases from RFC2202
|
||||
*
|
||||
|
@ -116,7 +116,7 @@ void test_hmac_md5_signer(tester_t *tester)
|
|||
/*
|
||||
* Described in header.
|
||||
*/
|
||||
void test_hmac_sha1_signer(tester_t *tester)
|
||||
void test_hmac_sha1_signer(protected_tester_t *tester)
|
||||
{
|
||||
/*
|
||||
* test_case = 7
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_hmac_md5_signer(tester_t *tester);
|
||||
void test_hmac_md5_signer(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the hmac sign functionality using SHA1.
|
||||
|
@ -41,6 +41,6 @@ void test_hmac_md5_signer(tester_t *tester);
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_hmac_sha1_signer(tester_t *tester);
|
||||
void test_hmac_sha1_signer(protected_tester_t *tester);
|
||||
|
||||
#endif //_HMAC_SIGNER_TEST_H_
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
/*
|
||||
* described in Header-File
|
||||
*/
|
||||
void test_hmac_sha1(tester_t *tester)
|
||||
void test_hmac_sha1(protected_tester_t *tester)
|
||||
{
|
||||
/*
|
||||
* Test cases from RFC2202
|
||||
|
@ -222,7 +222,7 @@ void test_hmac_sha1(tester_t *tester)
|
|||
/*
|
||||
* described in Header-File
|
||||
*/
|
||||
void test_hmac_md5(tester_t *tester)
|
||||
void test_hmac_md5(protected_tester_t *tester)
|
||||
{
|
||||
/*
|
||||
* Test cases from RFC2202
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_hmac_sha1(tester_t *tester);
|
||||
void test_hmac_sha1(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the hmac functionality
|
||||
|
@ -44,6 +44,6 @@ void test_hmac_sha1(tester_t *tester);
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_hmac_md5(tester_t *tester);
|
||||
void test_hmac_md5(protected_tester_t *tester);
|
||||
|
||||
#endif /*HMAC_TEST_H_*/
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
/*
|
||||
* described in Header-File
|
||||
*/
|
||||
void test_ike_sa_id(tester_t *tester)
|
||||
void test_ike_sa_id(protected_tester_t *tester)
|
||||
{
|
||||
ike_sa_id_t *ike_sa_id, *clone, *equal, *other1, *other2, *other3, *other4;
|
||||
u_int64_t initiator, initiator2, responder, responder2;
|
||||
|
|
|
@ -35,6 +35,6 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_ike_sa_id(tester_t *tester);
|
||||
void test_ike_sa_id(protected_tester_t *tester);
|
||||
|
||||
#endif /*IKE_SA_ID_TEST_H_*/
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
|
||||
static struct ike_sa_manager_test_struct_s {
|
||||
tester_t *tester;
|
||||
protected_tester_t *tester;
|
||||
ike_sa_manager_t *isam;
|
||||
} td;
|
||||
|
||||
|
@ -62,7 +62,7 @@ static void test3_thread(ike_sa_id_t *ike_sa_id)
|
|||
|
||||
|
||||
|
||||
void test_ike_sa_manager(tester_t *tester)
|
||||
void test_ike_sa_manager(protected_tester_t *tester)
|
||||
{
|
||||
status_t status;
|
||||
u_int64_t initiator, responder;
|
||||
|
|
|
@ -28,11 +28,11 @@
|
|||
/**
|
||||
* @brief Test function used to test the ike_sa_manager_t functionality.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_ike_sa_manager(tester_t *tester);
|
||||
void test_ike_sa_manager(protected_tester_t *tester);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <encoding/message.h>
|
||||
#include <sa/ike_sa.h>
|
||||
|
||||
void test_ike_sa(tester_t *tester)
|
||||
void test_ike_sa(protected_tester_t *tester)
|
||||
{
|
||||
ike_sa_t *ike_sa;
|
||||
ike_sa_id_t *ike_sa_id;
|
||||
|
|
|
@ -28,10 +28,10 @@
|
|||
/**
|
||||
* @brief Test function used to test the ike_sa_t functionality.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_ike_sa(tester_t *tester);
|
||||
void test_ike_sa(protected_tester_t *tester);
|
||||
|
||||
#endif /*IKE_SA_TEST_H_*/
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
/**
|
||||
* Described in header.
|
||||
*/
|
||||
void test_init_config(tester_t *tester)
|
||||
void test_init_config(protected_tester_t *tester)
|
||||
{
|
||||
init_config_t *init_config = init_config_create("192.168.0.1","192.168.0.2",500,500);
|
||||
ike_proposal_t prop1, prop2, prop3, prop4, selected_one;
|
||||
|
|
|
@ -29,10 +29,10 @@
|
|||
/**
|
||||
* @brief Test function used to test the init_config_t functionality.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_init_config(tester_t *tester);
|
||||
void test_init_config(protected_tester_t *tester);
|
||||
|
||||
#endif //_INIT_CONFIG_TEST_H_
|
||||
|
|
|
@ -39,7 +39,7 @@ typedef struct job_queue_test_s job_queue_test_t;
|
|||
*
|
||||
*/
|
||||
struct job_queue_test_s{
|
||||
tester_t *tester;
|
||||
protected_tester_t *tester;
|
||||
job_queue_t *job_queue;
|
||||
/**
|
||||
* number of items to be inserted in the job-queue
|
||||
|
@ -87,7 +87,7 @@ static void test_job_queue_receiver(job_queue_test_t * testinfo)
|
|||
/*
|
||||
* description is in header file
|
||||
*/
|
||||
void test_job_queue(tester_t *tester)
|
||||
void test_job_queue(protected_tester_t *tester)
|
||||
{
|
||||
int desired_value, i;
|
||||
int sender_count = 10;
|
||||
|
|
|
@ -35,6 +35,6 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_job_queue(tester_t *tester);
|
||||
void test_job_queue(protected_tester_t *tester);
|
||||
|
||||
#endif /*JOB_QUEUE_TEST_H_*/
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
/*
|
||||
* described in Header-File
|
||||
*/
|
||||
void test_kernel_interface(tester_t *tester)
|
||||
void test_kernel_interface(protected_tester_t *tester)
|
||||
{
|
||||
kernel_interface_t *kernel_interface;
|
||||
u_int32_t spi;
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_kernel_interface(tester_t *tester);
|
||||
void test_kernel_interface(protected_tester_t *tester);
|
||||
|
||||
|
||||
#endif /*KERNEL_INTERFACE_TEST_H_*/
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
/*
|
||||
* Description in header-file
|
||||
*/
|
||||
void test_linked_list(tester_t *tester)
|
||||
void test_linked_list(protected_tester_t *tester)
|
||||
{
|
||||
void *test_value = NULL;
|
||||
|
||||
|
@ -122,7 +122,7 @@ void test_linked_list(tester_t *tester)
|
|||
/*
|
||||
* Description in header-file
|
||||
*/
|
||||
void test_linked_list_iterator(tester_t *tester)
|
||||
void test_linked_list_iterator(protected_tester_t *tester)
|
||||
{
|
||||
void * value;
|
||||
|
||||
|
@ -187,7 +187,7 @@ void test_linked_list_iterator(tester_t *tester)
|
|||
/*
|
||||
* Description in header-file
|
||||
*/
|
||||
void test_linked_list_insert_and_remove(tester_t *tester)
|
||||
void test_linked_list_insert_and_remove(protected_tester_t *tester)
|
||||
{
|
||||
void *value;
|
||||
iterator_t * iterator;
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_linked_list(tester_t *tester);
|
||||
void test_linked_list(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function for the type linked_list_t and its iterator.
|
||||
|
@ -53,7 +53,7 @@ void test_linked_list(tester_t *tester);
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_linked_list_iterator(tester_t *tester);
|
||||
void test_linked_list_iterator(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function for the type linked_list_t and its insert and remove
|
||||
|
@ -69,6 +69,6 @@ void test_linked_list_iterator(tester_t *tester);
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_linked_list_insert_and_remove(tester_t *tester);
|
||||
void test_linked_list_insert_and_remove(protected_tester_t *tester);
|
||||
|
||||
#endif /*LINKED_LIST_TEST_H_*/
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
/*
|
||||
* Described in Header
|
||||
*/
|
||||
void test_packet(tester_t *tester)
|
||||
void test_packet(protected_tester_t *tester)
|
||||
{
|
||||
packet_t *packet = packet_create();
|
||||
packet_t *packet2;
|
||||
|
|
|
@ -28,10 +28,10 @@
|
|||
/**
|
||||
* @brief Test function used to test the packet_t functionality.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_packet(tester_t *tester);
|
||||
void test_packet(protected_tester_t *tester);
|
||||
|
||||
#endif /*PACKET_TEST_H_*/
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
/*
|
||||
* Described in Header
|
||||
*/
|
||||
void test_parser_with_header_payload(tester_t *tester)
|
||||
void test_parser_with_header_payload(protected_tester_t *tester)
|
||||
{
|
||||
parser_t *parser;
|
||||
ike_header_t *ike_header;
|
||||
|
@ -97,7 +97,7 @@ void test_parser_with_header_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in Header
|
||||
*/
|
||||
void test_parser_with_sa_payload(tester_t *tester)
|
||||
void test_parser_with_sa_payload(protected_tester_t *tester)
|
||||
{
|
||||
parser_t *parser;
|
||||
sa_payload_t *sa_payload;
|
||||
|
@ -411,7 +411,7 @@ void test_parser_with_sa_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in Header
|
||||
*/
|
||||
void test_parser_with_nonce_payload(tester_t *tester)
|
||||
void test_parser_with_nonce_payload(protected_tester_t *tester)
|
||||
{
|
||||
parser_t *parser;
|
||||
nonce_payload_t *nonce_payload;
|
||||
|
@ -449,7 +449,7 @@ void test_parser_with_nonce_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in Header
|
||||
*/
|
||||
void test_parser_with_id_payload(tester_t *tester)
|
||||
void test_parser_with_id_payload(protected_tester_t *tester)
|
||||
{
|
||||
parser_t *parser;
|
||||
id_payload_t *id_payload;
|
||||
|
@ -490,7 +490,7 @@ void test_parser_with_id_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in Header
|
||||
*/
|
||||
void test_parser_with_ke_payload(tester_t *tester)
|
||||
void test_parser_with_ke_payload(protected_tester_t *tester)
|
||||
{
|
||||
parser_t *parser;
|
||||
ke_payload_t *ke_payload;
|
||||
|
@ -530,7 +530,7 @@ void test_parser_with_ke_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in Header
|
||||
*/
|
||||
void test_parser_with_notify_payload(tester_t *tester)
|
||||
void test_parser_with_notify_payload(protected_tester_t *tester)
|
||||
{
|
||||
parser_t *parser;
|
||||
notify_payload_t *notify_payload;
|
||||
|
@ -575,7 +575,7 @@ void test_parser_with_notify_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in Header
|
||||
*/
|
||||
void test_parser_with_auth_payload(tester_t *tester)
|
||||
void test_parser_with_auth_payload(protected_tester_t *tester)
|
||||
{
|
||||
parser_t *parser;
|
||||
auth_payload_t *auth_payload;
|
||||
|
@ -614,7 +614,7 @@ void test_parser_with_auth_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in Header
|
||||
*/
|
||||
void test_parser_with_ts_payload(tester_t *tester)
|
||||
void test_parser_with_ts_payload(protected_tester_t *tester)
|
||||
{
|
||||
parser_t *parser;
|
||||
ts_payload_t *ts_payload;
|
||||
|
@ -701,7 +701,7 @@ void test_parser_with_ts_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in Header
|
||||
*/
|
||||
void test_parser_with_cert_payload(tester_t *tester)
|
||||
void test_parser_with_cert_payload(protected_tester_t *tester)
|
||||
{
|
||||
parser_t *parser;
|
||||
cert_payload_t *cert_payload;
|
||||
|
@ -740,7 +740,7 @@ void test_parser_with_cert_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in Header
|
||||
*/
|
||||
void test_parser_with_certreq_payload(tester_t *tester)
|
||||
void test_parser_with_certreq_payload(protected_tester_t *tester)
|
||||
{
|
||||
parser_t *parser;
|
||||
certreq_payload_t *certreq_payload;
|
||||
|
@ -779,7 +779,7 @@ void test_parser_with_certreq_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in Header
|
||||
*/
|
||||
void test_parser_with_delete_payload(tester_t *tester)
|
||||
void test_parser_with_delete_payload(protected_tester_t *tester)
|
||||
{
|
||||
parser_t *parser;
|
||||
delete_payload_t *delete_payload;
|
||||
|
@ -822,7 +822,7 @@ void test_parser_with_delete_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in Header
|
||||
*/
|
||||
void test_parser_with_vendor_id_payload(tester_t *tester)
|
||||
void test_parser_with_vendor_id_payload(protected_tester_t *tester)
|
||||
{
|
||||
parser_t *parser;
|
||||
vendor_id_payload_t *vendor_id_payload;
|
||||
|
@ -860,7 +860,7 @@ void test_parser_with_vendor_id_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in Header
|
||||
*/
|
||||
void test_parser_with_cp_payload(tester_t *tester)
|
||||
void test_parser_with_cp_payload(protected_tester_t *tester)
|
||||
{
|
||||
parser_t *parser;
|
||||
cp_payload_t *cp_payload;
|
||||
|
@ -930,7 +930,7 @@ void test_parser_with_cp_payload(tester_t *tester)
|
|||
/*
|
||||
* Described in Header
|
||||
*/
|
||||
void test_parser_with_eap_payload(tester_t *tester)
|
||||
void test_parser_with_eap_payload(protected_tester_t *tester)
|
||||
{
|
||||
parser_t *parser;
|
||||
eap_payload_t *eap_payload;
|
||||
|
|
|
@ -29,141 +29,141 @@
|
|||
* @brief Test function used to test the parser_t functionality when
|
||||
* parsing a header payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_parser_with_header_payload(tester_t *tester);
|
||||
void test_parser_with_header_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the parser_t functionality when
|
||||
* parsing a sa payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_parser_with_sa_payload(tester_t *tester);
|
||||
void test_parser_with_sa_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the parser_t functionality when
|
||||
* parsing a nonce payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_parser_with_nonce_payload(tester_t *tester);
|
||||
void test_parser_with_nonce_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the parser_t functionality when
|
||||
* parsing a ID payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_parser_with_id_payload(tester_t *tester);
|
||||
void test_parser_with_id_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the parser_t functionality when
|
||||
* parsing a ke payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_parser_with_ke_payload(tester_t *tester);
|
||||
void test_parser_with_ke_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the parser_t functionality when
|
||||
* parsing a notify payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_parser_with_notify_payload(tester_t *tester);
|
||||
void test_parser_with_notify_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the parser_t functionality when
|
||||
* parsing a AUTH payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_parser_with_auth_payload(tester_t *tester);
|
||||
void test_parser_with_auth_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the parser_t functionality when
|
||||
* parsing a TS payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_parser_with_ts_payload(tester_t *tester);
|
||||
void test_parser_with_ts_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the parser_t functionality when
|
||||
* parsing a CERT payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_parser_with_cert_payload(tester_t *tester);
|
||||
void test_parser_with_cert_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the parser_t functionality when
|
||||
* parsing a CERTREQ payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_parser_with_certreq_payload(tester_t *tester);
|
||||
void test_parser_with_certreq_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the parser_t functionality when
|
||||
* parsing a CERTREQ payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_parser_with_delete_payload(tester_t *tester);
|
||||
void test_parser_with_delete_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the parser_t functionality when
|
||||
* parsing a VENDOR ID payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_parser_with_vendor_id_payload(tester_t *tester);
|
||||
void test_parser_with_vendor_id_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the parser_t functionality when
|
||||
* parsing a CP payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_parser_with_cp_payload(tester_t *tester);
|
||||
void test_parser_with_cp_payload(protected_tester_t *tester);
|
||||
|
||||
/**
|
||||
* @brief Test function used to test the parser_t functionality when
|
||||
* parsing a EAP payload.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_parser_with_eap_payload(tester_t *tester);
|
||||
void test_parser_with_eap_payload(protected_tester_t *tester);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
/*
|
||||
* described in Header-File
|
||||
*/
|
||||
void test_prf_plus(tester_t *tester)
|
||||
void test_prf_plus(protected_tester_t *tester)
|
||||
{
|
||||
prf_plus_t *prf_plus;
|
||||
prf_t *prf;
|
||||
|
@ -72,7 +72,7 @@ void test_prf_plus(tester_t *tester)
|
|||
prf->destroy(prf);
|
||||
}
|
||||
|
||||
void test_prf_plus_md5(tester_t *tester)
|
||||
void test_prf_plus_md5(protected_tester_t *tester)
|
||||
{
|
||||
/* md5 test data
|
||||
u_int8_t nonce[] = {
|
||||
|
|
|
@ -33,6 +33,6 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_prf_plus(tester_t *tester);
|
||||
void test_prf_plus(protected_tester_t *tester);
|
||||
|
||||
#endif /*PRF_PLUS_TEST_H_*/
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
/*
|
||||
* described in Header-File
|
||||
*/
|
||||
void test_prime_pool(tester_t *tester)
|
||||
void test_prime_pool(protected_tester_t *tester)
|
||||
{
|
||||
mpz_t p1, p2, p3, p4;
|
||||
prime_pool_t *prime_pool;
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_prime_pool(tester_t *tester);
|
||||
void test_prime_pool(protected_tester_t *tester);
|
||||
|
||||
|
||||
#endif /*PRIME_POOL_TEST_H*/
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
*/
|
||||
#define DESTINATION_IP "127.0.0.1"
|
||||
|
||||
void test_receiver(tester_t *tester)
|
||||
void test_receiver(protected_tester_t *tester)
|
||||
{
|
||||
int i;
|
||||
receiver_t *receiver;
|
||||
|
|
|
@ -32,6 +32,6 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_receiver(tester_t *tester);
|
||||
void test_receiver(protected_tester_t *tester);
|
||||
|
||||
#endif /*RECEIVER_TEST_H_*/
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
/*
|
||||
* described in Header-File
|
||||
*/
|
||||
void test_rsa(tester_t *tester)
|
||||
void test_rsa(protected_tester_t *tester)
|
||||
{
|
||||
rsa_private_key_t *private_key;
|
||||
rsa_public_key_t *public_key;
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_rsa(tester_t *tester);
|
||||
void test_rsa(protected_tester_t *tester);
|
||||
|
||||
|
||||
#endif /*RSA_TEST_H*/
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
/**
|
||||
* Described in header.
|
||||
*/
|
||||
void test_sa_config(tester_t *tester)
|
||||
void test_sa_config(protected_tester_t *tester)
|
||||
{
|
||||
sa_config_t *sa_config;
|
||||
traffic_selector_t *ts_policy[3], *ts_request[4], *ts_reference[3], **ts_result;
|
||||
|
|
|
@ -29,11 +29,11 @@
|
|||
/**
|
||||
* @brief Test function used to test the sa_config_t functionality.
|
||||
*
|
||||
* @param tester associated tester_t object
|
||||
* @param tester associated protected_tester_t object
|
||||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_sa_config(tester_t *tester);
|
||||
void test_sa_config(protected_tester_t *tester);
|
||||
|
||||
#endif //_SA_CONFIG_TEST_H_
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
* This one uses relative time events, which are not that exact.
|
||||
* Test may fail on too slow machines.
|
||||
*/
|
||||
void test_scheduler(tester_t *tester)
|
||||
void test_scheduler(protected_tester_t *tester)
|
||||
{
|
||||
int job_count = 5;
|
||||
job_t *jobs[job_count];
|
||||
|
|
|
@ -32,6 +32,6 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_scheduler(tester_t *tester);
|
||||
void test_scheduler(protected_tester_t *tester);
|
||||
|
||||
#endif /*SCHEDULER_TEST_H_*/
|
||||
|
|
|
@ -36,9 +36,9 @@ typedef struct send_queue_test_s send_queue_test_t;
|
|||
|
||||
struct send_queue_test_s{
|
||||
/**
|
||||
* Associated tester_t object
|
||||
* Associated protected_tester_t object
|
||||
*/
|
||||
tester_t *tester;
|
||||
protected_tester_t *tester;
|
||||
|
||||
/**
|
||||
* Queue to test
|
||||
|
@ -95,7 +95,7 @@ static void test_send_queue_receiver(send_queue_test_t * testinfo)
|
|||
/*
|
||||
* description is in header file
|
||||
*/
|
||||
void test_send_queue(tester_t *tester)
|
||||
void test_send_queue(protected_tester_t *tester)
|
||||
{
|
||||
int desired_value, i;
|
||||
int sender_count = 10;
|
||||
|
|
|
@ -35,6 +35,6 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_send_queue(tester_t *tester);
|
||||
void test_send_queue(protected_tester_t *tester);
|
||||
|
||||
#endif /*SEND_QUEUE_TEST_H_*/
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
*/
|
||||
#define DESTINATION_IP "127.0.0.1"
|
||||
|
||||
void test_sender(tester_t *tester)
|
||||
void test_sender(protected_tester_t *tester)
|
||||
{
|
||||
int i;
|
||||
sender_t *sender;
|
||||
|
|
|
@ -32,6 +32,6 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_sender(tester_t *tester);
|
||||
void test_sender(protected_tester_t *tester);
|
||||
|
||||
#endif /*SENDER_TEST_H_*/
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
/*
|
||||
* Description in header file
|
||||
*/
|
||||
void test_socket(tester_t *tester)
|
||||
void test_socket(protected_tester_t *tester)
|
||||
{
|
||||
int packet_count = 5;
|
||||
int current;
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_socket(tester_t *tester);
|
||||
void test_socket(protected_tester_t *tester);
|
||||
|
||||
|
||||
#endif /*SOCKET_TEST_H_*/
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
/*
|
||||
* Description in header file
|
||||
*/
|
||||
void test_thread_pool(tester_t *tester)
|
||||
void test_thread_pool(protected_tester_t *tester)
|
||||
{
|
||||
size_t desired_pool_size = 10;
|
||||
size_t pool_size;
|
||||
|
|
|
@ -32,6 +32,6 @@
|
|||
*
|
||||
* @ingroup testcases
|
||||
*/
|
||||
void test_thread_pool(tester_t *tester);
|
||||
void test_thread_pool(protected_tester_t *tester);
|
||||
|
||||
#endif /*THREAD_POOL_TEST_H_*/
|
||||
|
|
|
@ -42,9 +42,9 @@ typedef struct private_tester_t private_tester_t;
|
|||
struct private_tester_t {
|
||||
|
||||
/**
|
||||
* Public interface of tester_t.
|
||||
* Protected interface of tester_t.
|
||||
*/
|
||||
tester_t public;
|
||||
protected_tester_t protected;
|
||||
|
||||
/**
|
||||
* Runs a specific test.
|
||||
|
@ -53,7 +53,7 @@ struct private_tester_t {
|
|||
* @param test_function test function to perform
|
||||
* @param test_name name for the given test
|
||||
*/
|
||||
void (*run_test) (private_tester_t *tester, void (*test_function) (tester_t * tester), char * test_name);
|
||||
void (*run_test) (private_tester_t *tester, void (*test_function) (protected_tester_t * tester), char * test_name);
|
||||
|
||||
/**
|
||||
* Returns the difference of to timeval structs in microseconds.
|
||||
|
@ -159,7 +159,7 @@ static long time_difference(private_tester_t *this,struct timeval *end_time, str
|
|||
/**
|
||||
* Implementation of private_tester_t.run_test.
|
||||
*/
|
||||
static void run_test(private_tester_t *this, void (*test_function) (tester_t * tester), char * test_name)
|
||||
static void run_test(private_tester_t *this, void (*test_function) (protected_tester_t * tester), char * test_name)
|
||||
{
|
||||
struct timeval start_time, end_time;
|
||||
long timediff;
|
||||
|
@ -167,7 +167,7 @@ static void run_test(private_tester_t *this, void (*test_function) (tester_t * t
|
|||
this->failed_asserts_count = 0;
|
||||
fprintf(this->output,"%-55s\n", test_name);
|
||||
gettimeofday(&start_time,NULL);
|
||||
test_function(&(this->public));
|
||||
test_function(&(this->protected));
|
||||
gettimeofday(&end_time,NULL);
|
||||
timediff = this->time_difference(this,&end_time, &start_time);
|
||||
|
||||
|
@ -215,7 +215,7 @@ static void assert_true(private_tester_t *this, bool to_be_true,char * assert_na
|
|||
*/
|
||||
static void assert_false(private_tester_t *this, bool to_be_false,char * assert_name)
|
||||
{
|
||||
this->public.assert_true(&(this->public),(!to_be_false),assert_name);
|
||||
this->protected.assert_true(&(this->protected),(!to_be_false),assert_name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -236,11 +236,11 @@ tester_t *tester_create(FILE *output, bool display_succeeded_asserts)
|
|||
private_tester_t *this = allocator_alloc_thing(private_tester_t);
|
||||
|
||||
/* public functions */
|
||||
this->public.destroy = (void (*) (tester_t *))destroy;
|
||||
this->public.perform_tests = (void (*) (tester_t *, test_t**)) perform_tests;
|
||||
this->public.perform_test = (void (*) (tester_t *, test_t*))perform_test;
|
||||
this->public.assert_true = (void (*) (tester_t *, bool, char*)) assert_true;
|
||||
this->public.assert_false = (void (*) (tester_t *, bool, char*)) assert_false;
|
||||
this->protected.public.destroy = (void (*) (tester_t *))destroy;
|
||||
this->protected.public.perform_tests = (void (*) (tester_t *, test_t**)) perform_tests;
|
||||
this->protected.public.perform_test = (void (*) (tester_t *, test_t*))perform_test;
|
||||
this->protected.assert_true = (void (*) (protected_tester_t *, bool, char*)) assert_true;
|
||||
this->protected.assert_false = (void (*) (protected_tester_t *, bool, char*)) assert_false;
|
||||
|
||||
/* private functions */
|
||||
this->run_test = run_test;
|
||||
|
@ -253,5 +253,5 @@ tester_t *tester_create(FILE *output, bool display_succeeded_asserts)
|
|||
this->output = output;
|
||||
pthread_mutex_init(&(this->mutex),NULL);
|
||||
|
||||
return &(this->public);
|
||||
return &(this->protected.public);
|
||||
}
|
||||
|
|
|
@ -28,10 +28,10 @@
|
|||
#include <types.h>
|
||||
|
||||
|
||||
typedef struct test_t test_t;
|
||||
|
||||
/* must be defined here cause it is used in test_t */
|
||||
typedef struct tester_t tester_t;
|
||||
typedef struct protected_tester_t protected_tester_t;
|
||||
|
||||
typedef struct test_t test_t;
|
||||
|
||||
/**
|
||||
* @brief Representing a specified test.
|
||||
|
@ -44,7 +44,7 @@ struct test_t {
|
|||
*
|
||||
* @param tester associated tester_t object
|
||||
*/
|
||||
void (*test_function) (tester_t * tester);
|
||||
void (*test_function) (protected_tester_t * tester);
|
||||
|
||||
/**
|
||||
* Name of the test.
|
||||
|
@ -52,6 +52,9 @@ struct test_t {
|
|||
char * test_name;
|
||||
};
|
||||
|
||||
|
||||
typedef struct tester_t tester_t;
|
||||
|
||||
/**
|
||||
* @brief A class to perform tests.
|
||||
*
|
||||
|
@ -61,7 +64,6 @@ struct test_t {
|
|||
* @ingroup utils
|
||||
*/
|
||||
struct tester_t {
|
||||
|
||||
/**
|
||||
* @brief Test all testcases in array tests with specific tester_t object.
|
||||
*
|
||||
|
@ -79,32 +81,6 @@ struct tester_t {
|
|||
*/
|
||||
void (*perform_test) (tester_t *tester, test_t *test);
|
||||
|
||||
/**
|
||||
* Is called in a testcase to check a specific situation for TRUE.
|
||||
*
|
||||
* Log-Values to the tester output are protected from multiple access.
|
||||
*
|
||||
* @warning This function should only be called in a test_function.
|
||||
*
|
||||
* @param this tester_t object
|
||||
* @param to_be_true assert which has to be TRUE
|
||||
* @param assert_name name of the assertion
|
||||
*/
|
||||
void (*assert_true) (tester_t *tester, bool to_be_true, char *assert_name);
|
||||
|
||||
/**
|
||||
* Is called in a testcase to check a specific situation for FALSE.
|
||||
*
|
||||
* Log-Values to the tester output are protected from multiple access.
|
||||
*
|
||||
* @warning This function should only be called in a test_function.
|
||||
*
|
||||
* @param this tester_t object
|
||||
* @param to_be_false assert which has to be FALSE
|
||||
* @param assert_name name of the assertion
|
||||
*/
|
||||
void (*assert_false) (tester_t *tester, bool to_be_false, char *assert_name);
|
||||
|
||||
/**
|
||||
* @brief Destroys a tester_t object.
|
||||
*
|
||||
|
@ -113,6 +89,49 @@ struct tester_t {
|
|||
void (*destroy) (tester_t *tester);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @brief A class used in a specific testcase.
|
||||
*
|
||||
* For each testcase an object of this type is passed to the testfunction. The testfunction uses this
|
||||
* object to check specific asserts with protected_tester_t.assert_true and protected_tester_t.assert_false.
|
||||
*
|
||||
* @b Constructors:
|
||||
* - tester_create()
|
||||
*
|
||||
* @ingroup utils
|
||||
*/
|
||||
struct protected_tester_t {
|
||||
|
||||
/**
|
||||
* Public functions of a tester_t object
|
||||
*/
|
||||
tester_t public;
|
||||
|
||||
/**
|
||||
* @brief Is called in a testcase to check a specific situation for TRUE.
|
||||
*
|
||||
* Log-Values to the tester output are protected from multiple access.
|
||||
*
|
||||
* @param this tester_t object
|
||||
* @param to_be_true assert which has to be TRUE
|
||||
* @param assert_name name of the assertion
|
||||
*/
|
||||
void (*assert_true) (protected_tester_t *tester, bool to_be_true, char *assert_name);
|
||||
|
||||
/**
|
||||
* @brief Is called in a testcase to check a specific situation for FALSE.
|
||||
*
|
||||
* Log-Values to the tester output are protected from multiple access.
|
||||
*
|
||||
* @param this tester_t object
|
||||
* @param to_be_false assert which has to be FALSE
|
||||
* @param assert_name name of the assertion
|
||||
*/
|
||||
void (*assert_false) (protected_tester_t *tester, bool to_be_false, char *assert_name);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @brief Creates a tester_t object used to perform tests with.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue