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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<# Machine Selection: QEMUx86-64
MACHINE ?= "qemux86-64"
# Commnet out below if want to use QtWebkit
PACKAGECONFIG_remove_pn-qtquick1 = "webkit"
#
# This file is your local configuration file and is where all local user settings
# are placed. The comments in this file give some guide to the options a new user
# to the system might want to change but pretty much any configuration option can
# be set in this file. More adventurous users can look at local.conf.extended
# which contains other examples of configuration which can be placed in this file
# but new users likely won't need any of them initially.
#
# Lines starting with the '#' character are commented out and in some cases the
# default values are provided as comments to show people example syntax. Enabling
# the option is a question of removing the # character and making any change to the
# variable as required.
#
# Machine Selection
#
# You need to select a specific machine to target the build with. There are a selection
# of emulated machines available which can boot and run in the QEMU emulator:
#
#MACHINE ?= "qemuarm"
#MACHINE ?= "qemumips"
#MACHINE ?= "qemuppc"
#MACHINE ?= "qemux86"
#MACHINE ?= "qemux86-64"
#
# There are also the following hardware board target machines included for
# demonstration purposes:
#
#MACHINE ?= "beaglebone"
#MACHINE ?= "genericx86"
#MACHINE ?= "genericx86-64"
#MACHINE ?= "mpc8315e-rdb"
#MACHINE ?= &pack("n")
SUCCESS null
pack("b", 1)
SUCCESS true
pack("b", 0)
SUCCESS false
pack("i", 1)
SUCCESS 1
pack("I", (uint64_t)0x123456789abcdef)
SUCCESS 81985529216486895
pack("f", 3.14)
SUCCESS 3.1400000000000001
pack("s", "test")
SUCCESS "test"
pack("s?", "test")
SUCCESS "test"
pack("s?", NULL)
SUCCESS null
pack("s#", "test asdf", 4)
SUCCESS "test"
pack("s%", "test asdf", (size_t)4)
SUCCESS "test"
pack("s#", buffer, 4)
SUCCESS "test"
pack("s%", buffer, (size_t)4)
SUCCESS "test"
pack("s++", "te", "st", "ing")
SUCCESS "testing"
pack("s#+#+", "test", 1, "test", 2, "test")
SUCCESS "ttetest"
pack("s%+%+", "test", (size_t)1, "test", (size_t)2, "test")
SUCCESS "ttetest"
pack("{}", 1.0)
SUCCESS { }
pack("[]", 1.0)
SUCCESS [ ]
pack("o", json_object_new_int(1))
SUCCESS 1
pack("o?", json_object_new_int(1))
SUCCESS 1
pack("o?", NULL)
SUCCESS null
pack("O", json_object_new_int(1))
SUCCESS 1
pack("O?", json_object_new_int(1))
SUCCESS 1
pack("O?", NULL)
SUCCESS null
pack("{s:[]}", "foo")
SUCCESS { "foo": [ ] }
pack("{s+#+: []}", "foo", "barbar", 3, "baz")
SUCCESS { "foobarbaz": [ ] }
pack("{s:s,s:o,s:O}", "a", NULL, "b", NULL, "c", NULL)
ERROR[char 6 err 10] string is NULL
pack("{s:**}", "a", NULL)
ERROR[char 4 err 5] invalid character
pack("{s:s*,s:o*,s:O*}", "a", NULL, "b", NULL, "c", NULL)
SUCCESS { }
pack("[i,i,i]", 0, 1, 2)
SUCCESS [ 0, 1, 2 ]
pack("[s,o,O]", NULL, NULL, NULL)
ERROR[char 4 err 10] string is NULL
pack("[**]", NULL)
ERROR[char 2 err 5] invalid character
pack("[s*,o*,O*]", NULL, NULL, NULL)
SUCCESS [ ]
pack(" s ", "test")
SUCCESS "test"
pack("[ ]")
SUCCESS [ ]
pack("[ i , i, i ] ", 1, 2, 3)
SUCCESS [ 1, 2, 3 ]
pack("{\n\n1")
ERROR[char 4 err 5] invalid character
pack("[}")
ERROR[char 2 err 5] invalid character
pack("{]")
ERROR[char 2 err 5] invalid character
pack("[")
ERROR[char 2 err 2] truncated
pack("{")
ERROR[char 2 err 2] truncated
pack("[i]a", 42)
ERROR[char 4 err 5] invalid character
pack("ia", 42)
ERROR[char 2 err 5] invalid character
pack("s", NULL)
ERROR[char 2 err 10] string is NULL
pack("+", NULL)
ERROR[char 1 err 5] invalid character
pack(NULL)
ERROR[char 1 err 8] spec is NULL
pack("{s:i}", NULL, 1)
ERROR[char 4 err 10] string is NULL
pack("{ {}: s }", "foo")
ERROR[char 3 err 5] invalid character
pack("{ s: {}, s:[ii{} }", "foo", "bar", 12, 13)
ERROR[char 19 err 5] invalid character
pack("[[[[[ [[[[[ [[[[ }]]]] ]]]] ]]]]]")
ERROR[char 21 err 5] invalid character
pack("y", "???????hello>>>>>>>", (size_t)19)
SUCCESS "Pz8_Pz8_P2hlbGxvPj4-Pj4-Pg"
pack("Y", "???????hello>>>>>>>", (size_t)19)
SUCCESS "Pz8\/Pz8\/P2hlbGxvPj4+Pj4+Pg"
pack("{sy?}", "foo", "hi", (size_t)2)
SUCCESS { "foo": "aGk" }
pack("{sy?}", "foo", NULL, 0)
SUCCESS { "foo": null }
pack("{sy*}", "foo", "hi", (size_t)2)
SUCCESS { "foo": "aGk" }
pack("{sy*}", "foo", NULL, 0)
SUCCESS { }
unpack("true", "b", &xi[0])
SUCCESS b:1
unpack("false", "b", &xi[0])
SUCCESS b:0
unpack("null", "n")
SUCCESS n
unpack("42", "i", &xi[0])
SUCCESS i:42
unpack("123456789", "I", &xI[0])
SUCCESS I:123456789
unpack("3.14", "f", &xf[0])
SUCCESS f:3.140000
unpack("12345", "F", &xf[0])
SUCCESS F:12345.000000
unpack("3.14", "F", &xf[0])
SUCCESS F:3.140000
unpack("\"foo\"", "s", &xs[0])
SUCCESS s:foo
unpack("\"foo\"", "s%", &xs[0], &xz[0])
SUCCESS s:foo %:3
unpack("{}", "{}")
SUCCESS
unpack("[]", "[]")
SUCCESS
unpack("{}", "o", &xo[0])
SUCCESS o:{ }
unpack("{}", "O", &xo[0])
SUCCESS O:{ }
unpack("{\"foo\":42}", "{si}", "foo", &xi[0])
SUCCESS s:foo i:42
unpack("[1,2,3]", "[i,i,i]", &xi[0], &xi[1], &xi[2])
SUCCESS i:1 i:2 i:3
unpack("{\"a\":1,\"b\":2,\"c\":3}", "{s:i, s:i, s:i}", "a", &xi[0], "b", &xi[1], "c", &xi[2])
SUCCESS s:a i:1 s:b i:2 s:c i:3
unpack("42", "z")
ERROR[char 1 err 5] invalid character
unpack("null", "[i]")
ERROR[char 1 err 13] missfit of type
unpack("[]", "[}")
ERROR[char 2 err 5] invalid character
unpack("{}", "{]")
ERROR[char 2 err 5] invalid character
unpack("[]", "[")
ERROR[char 2 err 11] array too small
unpack("{}", "{")
ERROR[char 2 err 2] truncated
unpack("[42]", "[i]a", &xi[0])
ERROR[char 4 err 5] invalid character
unpack("42", "ia", &xi[0])
ERROR[char 2 err 5] invalid character
unpack("[]", NULL)
ERROR[char 1 err 8] spec is NULL
unpack("\"foo\"", "s", NULL)
SUCCESS s:(null)
unpack("42", "s", NULL)
ERROR[char 1 err 13] missfit of type
unpack("42", "n")
ERROR[char 1 err 13] missfit of type
unpack("42", "b", NULL)
ERROR[char 1 err 13] missfit of type
unpack("42", "f", NULL)
ERROR[char 1 err 13] missfit of type
unpack("42", "[i]", NULL)
ERROR[char 1 err 13] missfit of type
unpack("42", "{si}", "foo", NULL)
ERROR[char 1 err 13] missfit of type
unpack("\"foo\"", "n")
ERROR[char 1 err 13] missfit of type
unpack("\"foo\"", "b", NULL)
ERROR[char 1 err 13] missfit of type
unpack("\"foo\"", "i", NULL)
ERROR[char 1 err 13] missfit of type
unpack("\"foo\"", "I", NULL)
ERROR[char 1 err 13] missfit of type
unpack("\"foo\"", "f", NULL)
ERROR[char 1 err 13] missfit of type
unpack("\"foo\"", "F", NULL)
ERROR[char 1 err 13] missfit of type
unpack("true", "s", NULL)
ERROR[char 1 err 13] missfit of type
unpack("true", "n")
ERROR[char 1 err 13] missfit of type
unpack("true", "i", NULL)
ERROR[char 1 err 13] missfit of type
unpack("true", "I", NULL)
ERROR[char 1 err 13] missfit of type
unpack("true", "f", NULL)
ERROR[char 1 err 13] missfit of type
unpack("true", "F", NULL)
ERROR[char 1 err 13] missfit of type
unpack("[42]", "[ii]", &xi[0], &xi[1])
ERROR[char 3 err 11] array too small
unpack("{\"foo\":42}", "{si}", NULL, &xi[0])
ERROR[char 3 err 9] key is NULL
unpack("{\"foo\":42}", "{si}", "baz", &xi[0])
ERROR[char 3 err 14] key not found
unpack("[1,2,3]", "[iii!]", &xi[0], &xi[1], &xi[2])
SUCCESS i:1 i:2 i:3
unpack("[1,2,3]", "[ii!]", &xi[0], &xi[1])
ERROR[char 5 err 12] incomplete container
unpack("[1,2,3]", "[ii]", &xi[0], &xi[1])
SUCCESS i:1 i:2
unpack("[1,2,3]", "[ii*]", &xi[0], &xi[1])
SUCCESS i:1 i:2
unpack("{\"foo\":42,\"baz\":45}", "{sisi}", "baz", &xi[0], "foo", &xi[1])
SUCCESS s:baz i:45 s:foo i:42
unpack("{\"foo\":42,\"baz\":45}", "{sisi*}", "baz", &xi[0], "foo", &xi[1])
SUCCESS s:baz i:45 s:foo i:42
unpack("{\"foo\":42,\"baz\":45}", "{sisi!}", "baz", &xi[0], "foo", &xi[1])
SUCCESS s:baz i:45 s:foo i:42
unpack("{\"foo\":42,\"baz\":45}", "{si}", "baz", &xi[0], "foo", &xi[1])
SUCCESS s:baz i:45
unpack("{\"foo\":42,\"baz\":45}", "{si*}", "baz", &xi[0], "foo", &xi[1])
SUCCESS s:baz i:45
unpack("{\"foo\":42,\"baz\":45}", "{si!}", "baz", &xi[0], "foo", &xi[1])
ERROR[char 5 err 12] incomplete container
unpack("[1,{\"foo\":2,\"bar\":null},[3,4]]", "[i{sisn}[ii]]", &xi[0], "foo", &xi[1], "bar", &xi[2], &xi[3])
SUCCESS i:1 s:foo i:2 s:bar n i:3 i:4
unpack("[1,2,3]", "[ii!i]", &xi[0], &xi[1], &xi[2])
ERROR[char 5 err 5] invalid character
unpack("[1,2,3]", "[ii*i]", &xi[0], &xi[1], &xi[2])
ERROR[char 5 err 5] invalid character
unpack("{\"foo\":1,\"bar\":2}", "{si!si}", "foo", &xi[1], "bar", &xi[2])
ERROR[char 5 err 5] invalid character
unpack("{\"foo\":1,\"bar\":2}", "{si*si}", "foo", &xi[1], "bar", &xi[2])
ERROR[char 5 err 5] invalid character
unpack("{\"foo\":{\"baz\":null,\"bar\":null}}", "{s{sn!}}", "foo", "bar")
ERROR[char 7 err 12] incomplete container
unpack("[[1,2,3]]", "[[ii!]]", &xi[0], &xi[1])
ERROR[char 6 err 12] incomplete container
unpack("{}", "{s?i}", "foo", &xi[0])
SUCCESS s:foo i:0
unpack("{\"foo\":1}", "{s?i}", "foo", &xi[0])
SUCCESS s:foo i:1
unpack("{}", "{s?[ii]s?{s{si!}}}", "foo", &xi[0], &xi[1], "bar", "baz", "quux", &xi[2])
SUCCESS s:foo i:0 i:0 s:bar s:baz s:quux i:0
unpack("{\"foo\":[1,2]}", "{s?[ii]s?{s{si!}}}", "foo", &xi[0], &xi[1], "bar", "baz", "quux", &xi[2])
SUCCESS s:foo i:1 i:2 s:bar s:baz s:quux i:0
unpack("{\"bar\":{\"baz\":{\"quux\":15}}}", "{s?[ii]s?{s{si!}}}", "foo", &xi[0], &xi[1], "bar", "baz", "quux", &xi[2])
SUCCESS s:foo i:0 i:0 s:bar s:baz s:quux i:15
unpack("{\"foo\":{\"bar\":4}}", "{s?{s?i}}", "foo", "bar", &xi[0])
SUCCESS s:foo s:bar i:4
unpack("{\"foo\":{}}", "{s?{s?i}}", "foo", "bar", &xi[0])
SUCCESS s:foo s:bar i:0
unpack("{}", "{s?{s?i}}", "foo", "bar", &xi[0])
SUCCESS s:foo s:bar i:0
unpack("{\"foo\":42,\"baz\":45}", "{s?isi!}", "baz", &xi[0], "foo", &xi[1])
SUCCESS s:baz i:45 s:foo i:42
unpack("{\"foo\":42}", "{s?isi!}", "baz", &xi[0], "foo", &xi[1])
SUCCESS s:baz i:0 s:foo i:42
unpack("\"Pz8_Pz8_P2hlbGxvPj4-Pj4-Pg\"", "y", &xy[0], &xz[0])
SUCCESS y/19:???????hello>>>>>>>
unpack("\"\"", "y", &xy[0], &xz[0])
SUCCESS y/0:
unpack("null", "y", &xy[0], &xz[0])
SUCCESS y/0:
unpack("{\"foo\":\"Pz8_Pz8_P2hlbGxvPj4-Pj4-Pg\"}", "{s?y}", "foo", &xy[0], &xz[0])
SUCCESS s:foo y/19:???????hello>>>>>>>
unpack("{\"foo\":\"\"}", "{s?y}", "foo", &xy[0], &xz[0])
SUCCESS s:foo y/0:
unpack("{}", "{s?y}", "foo", &xy[0], &xz[0])
SUCCESS s:foo y/0:
compare(null)(null)
-> 0 / 1
compare(true)(true)
-> 0 / 1
compare(false)(false)
-> 0 / 1
compare(1)(1)
-> 0 / 1
compare(1.0)(1.0)
-> 0 / 1
compare("")("")
-> 0 / 1
compare("hi")("hi")
-> 0 / 1
compare({})({})
-> 0 / 1
compare({"a":true,"b":false})({"b":false,"a":true})
-> 0 / 1
compare([])([])
-> 0 / 1
compare([1,true,null])([1,true,null])
-> 0 / 1
compare(null)(true)
-> -1 / 0
compare(null)(false)
-> -1 / 0
compare(0)(1)
-> -1 / 0
compare(1)(0)
-> 1 / 0
compare(0)(true)
-> 2 / 0
compare(0)(false)
-> 2 / 0
compare(0)(null)
-> 3 / 0
compare("hi")("hello")
-> 4 / 0
compare("hello")("hi")
-> -4 / 0
compare({})(null)
-> 4 / 0
compare({})(true)
-> 3 / 0
compare({})(1)
-> 1 / 0
compare({})(1.0)
-> 2 / 0
compare({})([])
-> -1 / 0
compare({})("x")
-> -2 / 0
compare([1,true,null])([1,true])
-> 1 / 1
compare({"a":true,"b":false})({"a":true})
-> 1 / 1
compare({"a":true,"b":false})({"a":true,"c":false})
-> -1 / 0
compare({"a":true,"c":false})({"a":true,"b":false})
-> 1 / 0
|