2
* Lasso library C unit tests
4
* Copyright (C) 2004 Entr'ouvert
5
* http://lasso.entrouvert.org
7
* Author: Emmanuel Raviart <eraviart@entrouvert.com>
9
* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; either version 2 of the License, or
12
* (at your option) any later version.
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29
#include <lasso/lasso.h>
32
START_TEST(test01_server_load_dump_empty_string)
34
LassoServer *serverContext;
35
serverContext = lasso_server_new_from_dump("");
36
fail_unless(serverContext == NULL,
37
"serverContext was created from an empty string dump");
41
START_TEST(test02_server_load_dump_random_string)
43
LassoServer *serverContext;
44
serverContext = lasso_server_new_from_dump("foo");
45
fail_unless(serverContext == NULL,
46
"serverContext was created from a fake dump");
50
START_TEST(test03_server_load_dump_random_xml)
52
LassoServer *serverContext;
53
serverContext = lasso_server_new_from_dump("<?xml version=\"1.0\"?><foo/>");
54
fail_unless(serverContext == NULL,
55
"serverContext was created from fake (but valid XML) dump");
63
Suite *s = suite_create("Basic");
64
TCase *tc_server_load_dump_empty_string = tcase_create("Create server from empty string");
65
TCase *tc_server_load_dump_random_string = tcase_create("Create server from random string");
66
TCase *tc_server_load_dump_random_xml = tcase_create("Create server from random XML");
67
suite_add_tcase(s, tc_server_load_dump_empty_string);
68
suite_add_tcase(s, tc_server_load_dump_random_string);
69
suite_add_tcase(s, tc_server_load_dump_random_xml);
70
tcase_add_test(tc_server_load_dump_empty_string, test01_server_load_dump_empty_string);
71
tcase_add_test(tc_server_load_dump_random_string, test02_server_load_dump_random_string);
72
tcase_add_test(tc_server_load_dump_random_xml, test03_server_load_dump_random_xml);