Branch data Line data Source code
1 : : /*
2 : : * Copyright 2024 Philip Chimento
3 : : * Copyright 2024 GNOME Foundation, Inc.
4 : : *
5 : : * SPDX-License-Identifier: LGPL-2.1-or-later
6 : : *
7 : : * This library is free software; you can redistribute it and/or
8 : : * modify it under the terms of the GNU Lesser General Public
9 : : * License as published by the Free Software Foundation; either
10 : : * version 2.1 of the License, or (at your option) any later version.
11 : : *
12 : : * This library is distributed in the hope that it will be useful,
13 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 : : * Lesser General Public License for more details.
16 : : *
17 : : * You should have received a copy of the GNU Lesser General
18 : : * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 : : *
20 : : * Author: Philip Withnall <pwithnall@gnome.org>
21 : : */
22 : :
23 : : #include "girepository.h"
24 : : #include "girffi.h"
25 : : #include "glib.h"
26 : : #include "test-common.h"
27 : :
28 : : static void
29 : 1 : test_function_info_invoker (RepositoryFixture *fx,
30 : : const void *unused)
31 : : {
32 : 1 : GIFunctionInfo *function_info = NULL;
33 : : GIFunctionInvoker invoker;
34 : 1 : GError *local_error = NULL;
35 : :
36 : 1 : g_test_summary ("Test preparing a function invoker");
37 : :
38 : 1 : function_info = GI_FUNCTION_INFO (gi_repository_find_by_name (fx->repository, "GLib", "get_locale_variants"));
39 : 1 : g_assert_nonnull (function_info);
40 : :
41 : 1 : gi_function_info_prep_invoker (function_info, &invoker, &local_error);
42 : 1 : g_assert_no_error (local_error);
43 : :
44 : 1 : gi_function_invoker_clear (&invoker);
45 : 1 : g_clear_pointer (&function_info, gi_base_info_unref);
46 : 1 : }
47 : :
48 : : int
49 : 1 : main (int argc,
50 : : char *argv[])
51 : : {
52 : 1 : repository_init (&argc, &argv);
53 : :
54 : 1 : ADD_REPOSITORY_TEST ("/function-info/invoker", test_function_info_invoker, &typelib_load_spec_glib);
55 : :
56 : 1 : return g_test_run ();
57 : : }
|