Branch data Line data Source code
1 : : /*
2 : : * GIO - GLib Input, Output and Streaming Library
3 : : *
4 : : * Copyright (C) 2022 Canonical Ltd.
5 : : *
6 : : * SPDX-License-Identifier: LGPL-2.1-or-later
7 : : *
8 : : * This library is free software; you can redistribute it and/or
9 : : * modify it under the terms of the GNU Lesser General Public
10 : : * License as published by the Free Software Foundation; either
11 : : * version 2.1 of the License, or (at your option) any later version.
12 : : *
13 : : * This library is distributed in the hope that it will be useful,
14 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 : : * Lesser General Public License for more details.
17 : : *
18 : : * You should have received a copy of the GNU Lesser General
19 : : * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
20 : : *
21 : : * Author: Marco Trevisan <marco.trevisan@canonical.com>
22 : : */
23 : :
24 : : #include "../gportalsupport.h"
25 : : #include <gio/gio.h>
26 : :
27 : : static void
28 : 1 : test_portal_support_env_var (void)
29 : : {
30 : 1 : g_assert_true (glib_should_use_portal ());
31 : 1 : g_assert_true (glib_network_available_in_sandbox ());
32 : 1 : g_assert_true (glib_has_dconf_access_in_sandbox ());
33 : 1 : }
34 : :
35 : : int
36 : 1 : main (int argc, char **argv)
37 : : {
38 : 1 : g_test_init (&argc, &argv, NULL);
39 : :
40 : 1 : g_setenv ("GIO_USE_PORTALS", "1", TRUE);
41 : :
42 : 1 : g_test_add_func ("/portal-support/env-var", test_portal_support_env_var);
43 : :
44 : 1 : return g_test_run ();
45 : : }
|