summaryrefslogtreecommitdiff
path: root/tests/gvariant-get-child.c
blob: a53ab277ae0b54231331fbac76879931ec95efa2 (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
41
42
/* Template: gvariant */

/*
 * 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 *' (aka 'unsigned int *').
 *         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);
}