]>
git.ipfire.org Git - thirdparty/strongswan.git/blob - src/libstrongswan/tests/suites/test_pen.c
2 * Copyright (C) 2013 Andreas Steffen
3 * HSR Hochschule fuer Technik Rapperswil
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 #include "test_suite.h"
21 /*******************************************************************************
25 START_TEST(test_pen_type_create
)
27 pen_type_t ita_1
= pen_type_create(PEN_ITA
, 100);
29 ck_assert(ita_1
.vendor_id
== PEN_ITA
);
30 ck_assert(ita_1
.type
== 100);
34 /*******************************************************************************
38 START_TEST(test_pen_type_equals
)
40 pen_type_t ita_1
= pen_type_create(PEN_ITA
, 100);
41 pen_type_t ita_2
= pen_type_create(PEN_ITA
, 200);
42 pen_type_t fhh_1
= pen_type_create(PEN_FHH
, 100);
43 pen_type_t fhh_2
= pen_type_create(PEN_FHH
, 200);
45 ck_assert( pen_type_equals(ita_1
, ita_1
));
46 ck_assert(!pen_type_equals(ita_1
, ita_2
));
47 ck_assert(!pen_type_equals(ita_1
, fhh_1
));
48 ck_assert(!pen_type_equals(ita_1
, fhh_2
));
52 /*******************************************************************************
56 START_TEST(test_pen_type_is
)
58 pen_type_t ita_1
= pen_type_create(PEN_ITA
, 100);
60 ck_assert( pen_type_is(ita_1
, PEN_ITA
, 100));
61 ck_assert(!pen_type_is(ita_1
, PEN_ITA
, 200));
62 ck_assert(!pen_type_is(ita_1
, PEN_FHH
, 100));
63 ck_assert(!pen_type_is(ita_1
, PEN_FHH
, 200));
67 Suite
*pen_suite_create()
72 s
= suite_create("pen");
74 tc
= tcase_create("create");
75 tcase_add_test(tc
, test_pen_type_create
);
76 suite_add_tcase(s
, tc
);
78 tc
= tcase_create("equals");
79 tcase_add_test(tc
, test_pen_type_equals
);
80 suite_add_tcase(s
, tc
);
82 tc
= tcase_create("is");
83 tcase_add_test(tc
, test_pen_type_is
);
84 suite_add_tcase(s
, tc
);