summaryrefslogtreecommitdiff
path: root/tests/gvariant-get-child.c
blob: 08c2bce0403824ae4a71f1d4c0bba000e55330d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 * No error
 */
{
	gchar *str1 = NULL, *str2 = NULL;
	g_variant_get_child (existing_variant, 0, "(ss)", &str1, &str2);
}

/*
 * No error
 */
{
	gchar *str1 = NULL, *str2 = NULL;
	g_variant_get_child (existing_variant, 0, "(ss)", NULL, NULL);
}

/*
 * No error
 */
{
	const gchar *str1 = NULL, *str2 = NULL;
	g_variant_get_child (existing_variant, 0, "(&s&s)", &str1, &str2);
}

/*
 * No error
 */
{
	g_variant_get_child (existing_variant, 0, "()");
}

/*
 * Expected a GVariant variadic argument of type ‘const char **’ but saw one of type ‘guint *’.
 *         g_variant_get_child (existing_variant, 0, "&s", &not_a_string);
 *                                                         ^
 */
{
	guint not_a_string;
	g_variant_get_child (existing_variant, 0, "&s", &not_a_string);
}