~ps-jenkins/libdbusmenu/trusty-proposed

4.2.4 by Ted Gould
Putting GPLv3 on some of these that were missing it.
1
/*
2
A test for libdbusmenu to ensure its quality.
3
4
Copyright 2009 Canonical Ltd.
5
6
Authors:
7
    Ted Gould <ted@canonical.com>
8
9
This program is free software: you can redistribute it and/or modify it 
10
under the terms of the GNU General Public License version 3, as published 
11
by the Free Software Foundation.
12
13
This program is distributed in the hope that it will be useful, but 
14
WITHOUT ANY WARRANTY; without even the implied warranties of 
15
MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 
16
PURPOSE.  See the GNU General Public License for more details.
17
18
You should have received a copy of the GNU General Public License along 
19
with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21
1.2.20 by Ted Gould
First parts of some tests to test the properties.
22
23
#include <glib.h>
24
25
typedef struct _proplayout_t proplayout_t;
26
struct _proplayout_t {
65.1.20 by Ted Gould
Changing the ID to be -1 instead of 0
27
	gint id;
1.2.20 by Ted Gould
First parts of some tests to test the properties.
28
	gchar ** properties;
29
	proplayout_t * submenu;
30
};
31
32
gchar * props1[] = {"property1", "value1", "property2", "value2", NULL};
33
gchar * props2[] = {"property00", "value00", "property01", "value01", "property02", "value02", "property03", "value03", "property04", "value04",
34
                    "property05", "value05", "property06", "value06", "property07", "value07", "property08", "value08", "property09", "value09",
35
                    "property10", "value10", "property11", "value11", "property12", "value12", "property13", "value13", "property14", "value14",
36
                    "property15", "value15", "property16", "value16", "property17", "value17", "property18", "value18", "property19", "value19",
37
                    "property20", "value20", "property21", "value21", "property22", "value22", "property23", "value23", "property24", "value24",
38
                    "property25", "value25", "property26", "value26", "property27", "value27", "property28", "value28", "property29", "value29",
39
                    "property30", "value30", "property31", "value31", "property32", "value32", "property33", "value33", "property34", "value34",
40
                    "property35", "value35", "property36", "value36", "property37", "value37", "property38", "value38", "property39", "value39",
41
                    "property40", "value40", "property41", "value41", "property42", "value42", "property43", "value43", "property44", "value44",
42
                    "property45", "value45", "property46", "value46", "property47", "value47", "property48", "value48", "property49", "value49",
43
                    "property50", "value50", "property51", "value51", "property52", "value52", "property53", "value53", "property54", "value54",
44
                    "property55", "value55", "property56", "value56", "property57", "value57", "property58", "value58", "property59", "value59",
45
                    "property60", "value60", "property61", "value61", "property62", "value62", "property63", "value63", "property64", "value64",
46
                    "property65", "value65", "property66", "value66", "property67", "value67", "property68", "value68", "property69", "value69",
47
                    "property70", "value70", "property71", "value71", "property72", "value72", "property73", "value73", "property74", "value74",
48
                    "property75", "value75", "property76", "value76", "property77", "value77", "property78", "value78", "property79", "value79",
49
                    "property80", "value80", "property81", "value81", "property82", "value82", "property83", "value83", "property84", "value84",
50
                    "property85", "value85", "property86", "value86", "property87", "value87", "property88", "value88", "property89", "value89",
51
                    "property90", "value90", "property91", "value91", "property92", "value92", "property93", "value93", "property94", "value94",
52
                    "property95", "value95", "property96", "value96", "property97", "value97", "property98", "value98", "property99", "value99",
53
                    NULL};
54
gchar * props3[] = {"property name that is really long and will ensure that we can really have long property names, which could be important at some point.",
55
                    "And a property name that is really long should have a value that is really long, because well, that's an important part of the yin and yang of software testing.",
56
                    NULL};
57
gchar * props4[] = {"icon-name", "network-status", "label", "Look at network", "right-column", "10:32", NULL};
58
59
60
proplayout_t submenu_4_1[] = {
61
	{id: 10, properties: props2, submenu: NULL},
62
	{id: 11, properties: props2, submenu: NULL},
63
	{id: 12, properties: props2, submenu: NULL},
64
	{id: 13, properties: props2, submenu: NULL},
65
	{id: 14, properties: props2, submenu: NULL},
66
	{id: 15, properties: props2, submenu: NULL},
67
	{id: 16, properties: props2, submenu: NULL},
68
	{id: 17, properties: props2, submenu: NULL},
69
	{id: 18, properties: props2, submenu: NULL},
70
	{id: 19, properties: props2, submenu: NULL},
65.1.20 by Ted Gould
Changing the ID to be -1 instead of 0
71
	{id: -1, properties: NULL, submenu: NULL}
1.2.20 by Ted Gould
First parts of some tests to test the properties.
72
};
73
74
proplayout_t submenu_4_2[] = {
75
	{id: 20, properties: props2, submenu: NULL},
76
	{id: 21, properties: props2, submenu: NULL},
77
	{id: 22, properties: props2, submenu: NULL},
78
	{id: 23, properties: props2, submenu: NULL},
79
	{id: 24, properties: props2, submenu: NULL},
80
	{id: 25, properties: props2, submenu: NULL},
81
	{id: 26, properties: props2, submenu: NULL},
82
	{id: 27, properties: props2, submenu: NULL},
83
	{id: 28, properties: props2, submenu: NULL},
84
	{id: 29, properties: props2, submenu: NULL},
65.1.20 by Ted Gould
Changing the ID to be -1 instead of 0
85
	{id: -1, properties: NULL, submenu: NULL}
1.2.20 by Ted Gould
First parts of some tests to test the properties.
86
};
87
88
proplayout_t submenu_4_3[] = {
89
	{id: 30, properties: props2, submenu: NULL},
90
	{id: 31, properties: props2, submenu: NULL},
91
	{id: 32, properties: props2, submenu: NULL},
92
	{id: 33, properties: props2, submenu: NULL},
93
	{id: 34, properties: props2, submenu: NULL},
94
	{id: 35, properties: props2, submenu: NULL},
95
	{id: 36, properties: props2, submenu: NULL},
96
	{id: 37, properties: props2, submenu: NULL},
97
	{id: 38, properties: props2, submenu: NULL},
98
	{id: 39, properties: props2, submenu: NULL},
65.1.20 by Ted Gould
Changing the ID to be -1 instead of 0
99
	{id: -1, properties: NULL, submenu: NULL}
1.2.20 by Ted Gould
First parts of some tests to test the properties.
100
};
101
102
proplayout_t submenu_4_0[] = {
103
	{id: 1, properties: props2, submenu: submenu_4_1},
104
	{id: 2, properties: props2, submenu: submenu_4_2},
105
	{id: 3, properties: props2, submenu: submenu_4_3},
65.1.20 by Ted Gould
Changing the ID to be -1 instead of 0
106
	{id: -1, properties: NULL, submenu: NULL}
1.2.20 by Ted Gould
First parts of some tests to test the properties.
107
};
108
109
proplayout_t layouts[] = {
110
	{id: 1, properties: props1, submenu: NULL},
111
	{id: 10, properties: props2, submenu: NULL},
112
	{id: 20, properties: props3, submenu: NULL},
113
	{id: 100, properties: props2, submenu: submenu_4_0},
65.1.20 by Ted Gould
Changing the ID to be -1 instead of 0
114
	{id: -1, properties: NULL, submenu: NULL}
1.2.20 by Ted Gould
First parts of some tests to test the properties.
115
};
116