aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon/testcases/ike_sa_test.c
blob: 0e12af6e5cdb6953d16daa25d159b735ae8e5996 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**
 * @file ike_sa_test.c
 * 
 * @brief Tests to test the IKE_SA type ike_sa_t
 * 
 */

/*
 * 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.
 */

#include "ike_sa_test.h"

#include "../types.h"
#include "../message.h"
#include "../ike_sa.h"

void test_ike_sa(tester_t *tester)
{
	ike_sa_t *ike_sa;
	ike_sa_id_t *ike_sa_id;
	u_int64_t initiator, responder;
	bool is_initiator;
	

	initiator = 0;
	responder = 34334LL;
	is_initiator = TRUE;
	/* create a ike_sa_id object for the new IKE_SA */
	ike_sa_id = ike_sa_id_create(initiator, responder, is_initiator);
	
	/* empty message and configuration objects are created */
	
	
	/* test every ike_sa function */
	ike_sa = ike_sa_create(ike_sa_id);
	
	ike_sa->initialize_connection(ike_sa, NULL);
	
	tester->assert_true(tester,(ike_sa != NULL), "ike_sa pointer check");

	tester->assert_true(tester,(ike_sa->destroy(ike_sa) == SUCCESS), "destroy call check");
	
	ike_sa_id->destroy(ike_sa_id);
}