2 * uuid.c: Tests for Virtualized Super Computer Management
4 * Copyright (C) 2009 Matthias Bolte <matthias.bolte@googlemail.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include "../utils/utils.h"
25 START_TEST (test_parse)
27 struct VscMgmtError error;
28 struct VscMgmtUuid uuid;
30 vsc_mgmt_error_init (&error);
32 vsc_mgmt_uuid_parse (&error, "131.234.92.31", &uuid);
33 fail_unless (error.occured);
35 vsc_mgmt_error_cleanup (&error);
37 vsc_mgmt_error_init (&error);
39 vsc_mgmt_uuid_parse (&error, "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", &uuid);
40 fail_unless (error.occured);
42 vsc_mgmt_error_cleanup (&error);
44 vsc_mgmt_error_init (&error);
46 vsc_mgmt_uuid_parse (&error, "1b4e28ba-2fa1-11d2-883f-b9a761bde3fb", &uuid);
47 fail_if (error.occured);
49 vsc_mgmt_error_cleanup (&error);
56 Suite *suite = suite_create ("UUID");
57 TCase *tcase = tcase_create ("general");
59 tcase_add_test (tcase, test_parse);
61 suite_add_tcase (suite, tcase);
70 SRunner *srunner = srunner_create (uuid_suite());
72 srunner_run_all (srunner, CK_NORMAL);
73 failed = srunner_ntests_failed (srunner);
74 srunner_free (srunner);