[kdbus] KDBUS_ITEM_PAYLOAD_OFF items are (once again) relative to msg header
[platform/upstream/glib.git] / gio / tests / vfs.c
1
2 /* Unit tests for GVfs
3  * Copyright (C) 2011 Red Hat, Inc
4  * Author: Matthias Clasen
5  *
6  * This work is provided "as is"; redistribution and modification
7  * in whole or in part, in any medium, physical or electronic is
8  * permitted without restriction.
9  *
10  * This work 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.
13  *
14  * In no event shall the authors or contributors be liable for any
15  * direct, indirect, incidental, special, exemplary, or consequential
16  * damages (including, but not limited to, procurement of substitute
17  * goods or services; loss of use, data, or profits; or business
18  * interruption) however caused and on any theory of liability, whether
19  * in contract, strict liability, or tort (including negligence or
20  * otherwise) arising in any way out of the use of this software, even
21  * if advised of the possibility of such damage.
22  */
23
24 #include <gio/gio.h>
25
26 static void
27 test_local (void)
28 {
29   GVfs *vfs;
30   GFile *file;
31   gchar **schemes;
32
33   vfs = g_vfs_get_local ();
34   g_assert (g_vfs_is_active (vfs));
35
36   file = g_vfs_get_file_for_uri (vfs, "not a good uri");
37   g_assert (G_IS_FILE (file));
38   g_object_unref (file);
39
40   schemes = (gchar **)g_vfs_get_supported_uri_schemes (vfs);
41
42   g_assert (g_strv_length (schemes) > 0);
43   g_assert_cmpstr (schemes[0], ==, "file");
44 }
45
46 int
47 main (int argc, char *argv[])
48 {
49   g_test_init (&argc, &argv, NULL);
50
51   g_test_add_func ("/gvfs/local", test_local);
52
53   return g_test_run ();
54 }