99c39487d6aad14f01265e0a95a6ad3126dd5393
[strongswan.git] / Source / charon / tests / generator_test.c
1 /**
2 * @file generator.h
3 *
4 * @brief Tests to test the Generator class generator_t
5 *
6 */
7
8 /*
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
11 *
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>.
16 *
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
20 * for more details.
21 */
22
23 #include "generator_test.h"
24 #include "../tester.h"
25 #include "../encodings.h"
26 #include "../generator.h"
27
28 extern payload_info_t *payload_infos[];
29
30 void test_generator_with_unsupported_payload(tester_t *tester)
31 {
32 generator_t *generator;
33 void * data_struct;
34 chunk_t generated_data;
35
36 generator = generator_create(payload_infos);
37 tester->assert_true(tester,(generator != NULL), "generator create check");
38 tester->assert_true(tester,(generator->generate_payload(generator,(payload_type_t) -1,data_struct,&generated_data) == NOT_SUPPORTED),"generate_payload call check");
39
40 tester->assert_true(tester,(generator->destroy(generator) == SUCCESS), "generator destroy call check");
41 }