(root)/
glib-2.79.0/
gio/
tests/
portal-support-env-var.c
       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  test_portal_support_env_var (void)
      29  {
      30    g_assert_true (glib_should_use_portal ());
      31    g_assert_true (glib_network_available_in_sandbox ());
      32    g_assert_true (glib_has_dconf_access_in_sandbox ());
      33  }
      34  
      35  int
      36  main (int argc, char **argv)
      37  {
      38    g_test_init (&argc, &argv, NULL);
      39  
      40    g_setenv ("GIO_USE_PORTALS", "1", TRUE);
      41  
      42    g_test_add_func ("/portal-support/env-var", test_portal_support_env_var);
      43  
      44    return g_test_run ();
      45  }