Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test_blobmsg.t « cram « tests - git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0c192c57ed2391627676a2204a07cc781b00f1c8 (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
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
check that blobmsg is producing expected results:

  $ [ -n "$TEST_BIN_DIR" ] && export PATH="$TEST_BIN_DIR:$PATH"

  $ valgrind --quiet --leak-check=full test-blobmsg
  [*] blobmsg dump:
  Message: Hello, world!
  List: {
  0 (i8)
  100 (i8)
  -128 (i8)
  127 (i8)
  -32768 (i16)
  32767 (i16)
  -2147483648 (i32)
  2147483647 (i32)
  -9223372036854775808 (i64)
  9223372036854775807 (i64)
  0.000000 (dbl)
  179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (dbl)
  }
  Testdata: {
  \tdbl-min : 0.000000 (dbl) (esc)
  \tdbl-max : 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (dbl) (esc)
  \tfoo : 0 (i8) (esc)
  \tpoo : 100 (i8) (esc)
  \tmoo-min : -128 (i8) (esc)
  \tmoo-max : 127 (i8) (esc)
  \tbar-min : -32768 (i16) (esc)
  \tbar-max : 32767 (i16) (esc)
  \tbaz-min : -2147483648 (i32) (esc)
  \tbaz-max : 2147483647 (i32) (esc)
  \ttaz-min : -9223372036854775808 (i64) (esc)
  \ttaz-max : 9223372036854775807 (i64) (esc)
  \tworld : 2 (str) (esc)
  }
  
  [*] blobmsg to json: {"message":"Hello, world!","testdata":{"dbl-min":0.000000,"dbl-max":179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000,"foo":false,"poo":true,"moo-min":true,"moo-max":true,"bar-min":-32768,"bar-max":32767,"baz-min":-2147483648,"baz-max":2147483647,"taz-min":-9223372036854775808,"taz-max":9223372036854775807,"world":"2"},"list":[false,true,true,true,-32768,32767,-2147483648,2147483647,-9223372036854775808,9223372036854775807,0.000000,179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000]}
  
  [*] blobmsg from json:
  Message: Hello, world!
  List: {
  0 (i8)
  1 (i8)
  1 (i8)
  1 (i8)
  -32768 (i32)
  32767 (i32)
  -2147483648 (i32)
  2147483647 (i32)
  -9223372036854775808 (i64)
  9223372036854775807 (i64)
  0.000000 (dbl)
  179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (dbl)
  }
  Testdata: {
  \tdbl-min : 0.000000 (dbl) (esc)
  \tdbl-max : 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (dbl) (esc)
  \tfoo : 0 (i8) (esc)
  \tpoo : 1 (i8) (esc)
  \tmoo-min : 1 (i8) (esc)
  \tmoo-max : 1 (i8) (esc)
  \tbar-min : -32768 (i32) (esc)
  \tbar-max : 32767 (i32) (esc)
  \tbaz-min : -2147483648 (i32) (esc)
  \tbaz-max : 2147483647 (i32) (esc)
  \ttaz-min : -9223372036854775808 (i64) (esc)
  \ttaz-max : 9223372036854775807 (i64) (esc)
  \tworld : 2 (str) (esc)
  }

  $ test-blobmsg-san
  [*] blobmsg dump:
  Message: Hello, world!
  List: {
  0 (i8)
  100 (i8)
  -128 (i8)
  127 (i8)
  -32768 (i16)
  32767 (i16)
  -2147483648 (i32)
  2147483647 (i32)
  -9223372036854775808 (i64)
  9223372036854775807 (i64)
  0.000000 (dbl)
  179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (dbl)
  }
  Testdata: {
  \tdbl-min : 0.000000 (dbl) (esc)
  \tdbl-max : 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (dbl) (esc)
  \tfoo : 0 (i8) (esc)
  \tpoo : 100 (i8) (esc)
  \tmoo-min : -128 (i8) (esc)
  \tmoo-max : 127 (i8) (esc)
  \tbar-min : -32768 (i16) (esc)
  \tbar-max : 32767 (i16) (esc)
  \tbaz-min : -2147483648 (i32) (esc)
  \tbaz-max : 2147483647 (i32) (esc)
  \ttaz-min : -9223372036854775808 (i64) (esc)
  \ttaz-max : 9223372036854775807 (i64) (esc)
  \tworld : 2 (str) (esc)
  }
  
  [*] blobmsg to json: {"message":"Hello, world!","testdata":{"dbl-min":0.000000,"dbl-max":179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000,"foo":false,"poo":true,"moo-min":true,"moo-max":true,"bar-min":-32768,"bar-max":32767,"baz-min":-2147483648,"baz-max":2147483647,"taz-min":-9223372036854775808,"taz-max":9223372036854775807,"world":"2"},"list":[false,true,true,true,-32768,32767,-2147483648,2147483647,-9223372036854775808,9223372036854775807,0.000000,179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000]}
  
  [*] blobmsg from json:
  Message: Hello, world!
  List: {
  0 (i8)
  1 (i8)
  1 (i8)
  1 (i8)
  -32768 (i32)
  32767 (i32)
  -2147483648 (i32)
  2147483647 (i32)
  -9223372036854775808 (i64)
  9223372036854775807 (i64)
  0.000000 (dbl)
  179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (dbl)
  }
  Testdata: {
  \tdbl-min : 0.000000 (dbl) (esc)
  \tdbl-max : 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (dbl) (esc)
  \tfoo : 0 (i8) (esc)
  \tpoo : 1 (i8) (esc)
  \tmoo-min : 1 (i8) (esc)
  \tmoo-max : 1 (i8) (esc)
  \tbar-min : -32768 (i32) (esc)
  \tbar-max : 32767 (i32) (esc)
  \tbaz-min : -2147483648 (i32) (esc)
  \tbaz-max : 2147483647 (i32) (esc)
  \ttaz-min : -9223372036854775808 (i64) (esc)
  \ttaz-max : 9223372036854775807 (i64) (esc)
  \tworld : 2 (str) (esc)
  }

  $ test-blobmsg-san
  [*] blobmsg dump:
  Message: Hello, world!
  List: {
  0 (i8)
  100 (i8)
  -128 (i8)
  127 (i8)
  -32768 (i16)
  32767 (i16)
  -2147483648 (i32)
  2147483647 (i32)
  -9223372036854775808 (i64)
  9223372036854775807 (i64)
  0.000000 (dbl)
  179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (dbl)
  }
  Testdata: {
  \tdbl-min : 0.000000 (dbl) (esc)
  \tdbl-max : 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (dbl) (esc)
  \tfoo : 0 (i8) (esc)
  \tpoo : 100 (i8) (esc)
  \tmoo-min : -128 (i8) (esc)
  \tmoo-max : 127 (i8) (esc)
  \tbar-min : -32768 (i16) (esc)
  \tbar-max : 32767 (i16) (esc)
  \tbaz-min : -2147483648 (i32) (esc)
  \tbaz-max : 2147483647 (i32) (esc)
  \ttaz-min : -9223372036854775808 (i64) (esc)
  \ttaz-max : 9223372036854775807 (i64) (esc)
  \tworld : 2 (str) (esc)
  }
  
  [*] blobmsg to json: {"message":"Hello, world!","testdata":{"dbl-min":0.000000,"dbl-max":179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000,"foo":false,"poo":true,"moo-min":true,"moo-max":true,"bar-min":-32768,"bar-max":32767,"baz-min":-2147483648,"baz-max":2147483647,"taz-min":-9223372036854775808,"taz-max":9223372036854775807,"world":"2"},"list":[false,true,true,true,-32768,32767,-2147483648,2147483647,-9223372036854775808,9223372036854775807,0.000000,179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000]}
  
  [*] blobmsg from json:
  Message: Hello, world!
  List: {
  0 (i8)
  1 (i8)
  1 (i8)
  1 (i8)
  -32768 (i32)
  32767 (i32)
  -2147483648 (i32)
  2147483647 (i32)
  -9223372036854775808 (i64)
  9223372036854775807 (i64)
  0.000000 (dbl)
  179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (dbl)
  }
  Testdata: {
  \tdbl-min : 0.000000 (dbl) (esc)
  \tdbl-max : 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (dbl) (esc)
  \tfoo : 0 (i8) (esc)
  \tpoo : 1 (i8) (esc)
  \tmoo-min : 1 (i8) (esc)
  \tmoo-max : 1 (i8) (esc)
  \tbar-min : -32768 (i32) (esc)
  \tbar-max : 32767 (i32) (esc)
  \tbaz-min : -2147483648 (i32) (esc)
  \tbaz-max : 2147483647 (i32) (esc)
  \ttaz-min : -9223372036854775808 (i64) (esc)
  \ttaz-max : 9223372036854775807 (i64) (esc)
  \tworld : 2 (str) (esc)
  }

  $ test-blobmsg-san
  [*] blobmsg dump:
  Message: Hello, world!
  List: {
  0 (i8)
  100 (i8)
  -128 (i8)
  127 (i8)
  -32768 (i16)
  32767 (i16)
  -2147483648 (i32)
  2147483647 (i32)
  -9223372036854775808 (i64)
  9223372036854775807 (i64)
  0.000000 (dbl)
  179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (dbl)
  }
  Testdata: {
  \tdbl-min : 0.000000 (dbl) (esc)
  \tdbl-max : 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (dbl) (esc)
  \tfoo : 0 (i8) (esc)
  \tpoo : 100 (i8) (esc)
  \tmoo-min : -128 (i8) (esc)
  \tmoo-max : 127 (i8) (esc)
  \tbar-min : -32768 (i16) (esc)
  \tbar-max : 32767 (i16) (esc)
  \tbaz-min : -2147483648 (i32) (esc)
  \tbaz-max : 2147483647 (i32) (esc)
  \ttaz-min : -9223372036854775808 (i64) (esc)
  \ttaz-max : 9223372036854775807 (i64) (esc)
  \tworld : 2 (str) (esc)
  }
  
  [*] blobmsg to json: {"message":"Hello, world!","testdata":{"dbl-min":0.000000,"dbl-max":179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000,"foo":false,"poo":true,"moo-min":true,"moo-max":true,"bar-min":-32768,"bar-max":32767,"baz-min":-2147483648,"baz-max":2147483647,"taz-min":-9223372036854775808,"taz-max":9223372036854775807,"world":"2"},"list":[false,true,true,true,-32768,32767,-2147483648,2147483647,-9223372036854775808,9223372036854775807,0.000000,179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000]}
  
  [*] blobmsg from json:
  Message: Hello, world!
  List: {
  0 (i8)
  1 (i8)
  1 (i8)
  1 (i8)
  -32768 (i32)
  32767 (i32)
  -2147483648 (i32)
  2147483647 (i32)
  -9223372036854775808 (i64)
  9223372036854775807 (i64)
  0.000000 (dbl)
  179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (dbl)
  }
  Testdata: {
  \tdbl-min : 0.000000 (dbl) (esc)
  \tdbl-max : 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 (dbl) (esc)
  \tfoo : 0 (i8) (esc)
  \tpoo : 1 (i8) (esc)
  \tmoo-min : 1 (i8) (esc)
  \tmoo-max : 1 (i8) (esc)
  \tbar-min : -32768 (i32) (esc)
  \tbar-max : 32767 (i32) (esc)
  \tbaz-min : -2147483648 (i32) (esc)
  \tbaz-max : 2147483647 (i32) (esc)
  \ttaz-min : -9223372036854775808 (i64) (esc)
  \ttaz-max : 9223372036854775807 (i64) (esc)
  \tworld : 2 (str) (esc)
  }