1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2
/* unit-test-oid.c: Test OID routines
3
Copyright (C) 2008 Stefan Walter
5
The Gnome Keyring Library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public License as
7
published by the Free Software Foundation; either version 2 of the
8
License, or (at your option) any later version.
10
The Gnome Keyring Library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Library General Public License for more details.
15
You should have received a copy of the GNU Library General Public
16
License along with the Gnome Library; see the file COPYING.LIB. If not,
17
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
Boston, MA 02111-1307, USA.
20
Author: Stef Walter <stef@memberwebs.com>
25
#include "egg/egg-oid.h"
34
oid = g_quark_from_static_string ("0.9.2342.19200300.100.1.25");
35
g_assert_cmpstr (egg_oid_get_name (oid), ==, "DC");
36
g_assert_cmpstr (egg_oid_get_description (oid), ==, "Domain Component");
37
g_assert_cmpuint (egg_oid_get_flags (oid), ==, EGG_OID_PRINTABLE);
39
/* Should return OID for invalid oids */
40
oid = g_quark_from_static_string ("1.1.1.1.1");
41
g_assert_cmpstr (egg_oid_get_name (oid), ==, "1.1.1.1.1");
42
g_assert_cmpstr (egg_oid_get_description (oid), ==, "1.1.1.1.1");
43
g_assert_cmpuint (egg_oid_get_flags (oid), ==, 0);
47
main (int argc, char **argv)
49
g_test_init (&argc, &argv, NULL);
51
g_test_add_func ("/oid/tests", test_tests);