Use macros for refcount types API
[glib.git] / gio / tests / unix-mounts.c
blob3d54047dc798cfb2e5ff224f31d4615296e14f82
1 /* GLib testing framework examples and tests
3 * Copyright © 2017 Endless Mobile, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This 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 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 #include <glib.h>
21 #ifndef G_OS_UNIX
22 #error This is a Unix-specific test
23 #endif
25 #include <errno.h>
26 #include <locale.h>
27 #include <glib/gstdio.h>
28 #include <gio/gio.h>
29 #include <gio/gunixmounts.h>
31 static void
32 test_is_system_fs_type (void)
34 g_assert_true (g_unix_is_system_fs_type ("tmpfs"));
35 g_assert_false (g_unix_is_system_fs_type ("ext4"));
38 static void
39 test_is_system_device_path (void)
41 g_assert_true (g_unix_is_system_device_path ("devpts"));
42 g_assert_false (g_unix_is_system_device_path ("/"));
45 int
46 main (int argc,
47 char *argv[])
49 setlocale (LC_ALL, "");
51 g_test_init (&argc, &argv, NULL);
53 g_test_add_func ("/unix-mounts/is-system-fs-type", test_is_system_fs_type);
54 g_test_add_func ("/unix-mounts/is-system-device-path", test_is_system_device_path);
56 return g_test_run ();