Line data Source code
1 : /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2 : /* test-secret-util.c: Test secret utils
3 :
4 : Copyright (C) 2010 Stefan Walter
5 :
6 : The Gnome Keyring Library is free software; you can redistribute it and/or
7 : modify it under the terms of the GNU Library General Public License as
8 : published by the Free Software Foundation; either version 2 of the
9 : License, or (at your option) any later version.
10 :
11 : The Gnome Keyring 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 : Library General Public License for more details.
15 :
16 : You should have received a copy of the GNU Library General Public
17 : License along with the Gnome Library; see the file COPYING.LIB. If not,
18 : <http://www.gnu.org/licenses/>.
19 :
20 : Author: Stef Walter <stef@memberwebs.com>
21 : */
22 :
23 : #include "config.h"
24 :
25 : #include "gkd-secret-util.h"
26 :
27 : #include <glib.h>
28 :
29 : #include <string.h>
30 :
31 : static void
32 1 : test_build_path (void)
33 : {
34 1 : const gchar *identifier = "par_d\xc3\xa9""faut";
35 : gchar *result;
36 :
37 1 : result = gkd_secret_util_build_path ("/path/", identifier, strlen (identifier));
38 1 : g_assert (result);
39 :
40 1 : g_assert_cmpstr (result, ==, "/path/par_5fd_c3_a9faut");
41 1 : g_free (result);
42 1 : }
43 :
44 :
45 : int
46 1 : main (int argc, char **argv)
47 : {
48 1 : g_test_init (&argc, &argv, NULL);
49 :
50 1 : g_test_add_func ("/secret-util/build-path", test_build_path);
51 :
52 1 : return g_test_run ();
53 : }
|