ruby-dbus 0.18.0.beta1 → 0.18.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1639 @@
1
+ ---
2
+ # Test data for marshalling and unmarshalling of D-Bus values.
3
+ # The intent is to be implementation independent.
4
+ # More importantly, it should work both ways, for marshalling and unmarshalling.
5
+ #
6
+ # This file is a list of test cases.
7
+ #
8
+ # Each test case is a dictionary:
9
+ # - sig: the signature of the data
10
+ # - end: endianness of the byte buffer ("big" or "little")
11
+ # - buf: the byte buffer. Logically it is an array of bytes but YAML
12
+ # would write that in base-64, obscuring the contents.
13
+ # So we write it as nested lists of integers (bytes), or UTF-8 strings.
14
+ # The nesting only matters for test case readability, the data is
15
+ # flattened before use.
16
+ # - val: the unmarshalled value (for valid buffers)
17
+ # - exc: exception name (for invalid buffers)
18
+ # - msg: exception message substring (for invalid buffers)
19
+ # - marshall: true (default) or false,
20
+ # - unmarshall: true (default) or false, for test cases that only work one way
21
+ # or are expected to fail
22
+
23
+ - sig: "y"
24
+ end: little
25
+ buf:
26
+ - 0
27
+ val: 0
28
+ - sig: "y"
29
+ end: little
30
+ buf:
31
+ - 128
32
+ val: 128
33
+ - sig: "y"
34
+ end: little
35
+ buf:
36
+ - 255
37
+ val: 255
38
+ - sig: "y"
39
+ end: big
40
+ buf:
41
+ - 0
42
+ val: 0
43
+ - sig: "y"
44
+ end: big
45
+ buf:
46
+ - 128
47
+ val: 128
48
+ - sig: "y"
49
+ end: big
50
+ buf:
51
+ - 255
52
+ val: 255
53
+ - sig: b
54
+ end: little
55
+ buf: [1, 0, 0, 0]
56
+ val: true
57
+ - sig: b
58
+ end: little
59
+ buf: [0, 0, 0, 0]
60
+ val: false
61
+ - sig: b
62
+ end: big
63
+ buf: [0, 0, 0, 1]
64
+ val: true
65
+ - sig: b
66
+ end: big
67
+ buf: [0, 0, 0, 0]
68
+ val: false
69
+ - sig: b
70
+ end: little
71
+ buf:
72
+ - 0
73
+ - 255
74
+ - 255
75
+ - 0
76
+ exc: DBus::InvalidPacketException
77
+ msg: BOOLEAN must be 0 or 1, found
78
+ - sig: b
79
+ end: big
80
+ buf:
81
+ - 0
82
+ - 255
83
+ - 255
84
+ - 0
85
+ exc: DBus::InvalidPacketException
86
+ msg: BOOLEAN must be 0 or 1, found
87
+ - sig: "n"
88
+ end: little
89
+ buf:
90
+ - 0
91
+ - 0
92
+ val: 0
93
+ - sig: "n"
94
+ end: little
95
+ buf:
96
+ - 255
97
+ - 127
98
+ val: 32767
99
+ - sig: "n"
100
+ end: little
101
+ buf:
102
+ - 0
103
+ - 128
104
+ val: -32768
105
+ - sig: "n"
106
+ end: little
107
+ buf:
108
+ - 255
109
+ - 255
110
+ val: -1
111
+ - sig: "n"
112
+ end: big
113
+ buf:
114
+ - 0
115
+ - 0
116
+ val: 0
117
+ - sig: "n"
118
+ end: big
119
+ buf:
120
+ - 127
121
+ - 255
122
+ val: 32767
123
+ - sig: "n"
124
+ end: big
125
+ buf:
126
+ - 128
127
+ - 0
128
+ val: -32768
129
+ - sig: "n"
130
+ end: big
131
+ buf:
132
+ - 255
133
+ - 255
134
+ val: -1
135
+ - sig: q
136
+ end: little
137
+ buf:
138
+ - 0
139
+ - 0
140
+ val: 0
141
+ - sig: q
142
+ end: little
143
+ buf:
144
+ - 255
145
+ - 127
146
+ val: 32767
147
+ - sig: q
148
+ end: little
149
+ buf:
150
+ - 0
151
+ - 128
152
+ val: 32768
153
+ - sig: q
154
+ end: little
155
+ buf:
156
+ - 255
157
+ - 255
158
+ val: 65535
159
+ - sig: q
160
+ end: big
161
+ buf:
162
+ - 0
163
+ - 0
164
+ val: 0
165
+ - sig: q
166
+ end: big
167
+ buf:
168
+ - 127
169
+ - 255
170
+ val: 32767
171
+ - sig: q
172
+ end: big
173
+ buf:
174
+ - 128
175
+ - 0
176
+ val: 32768
177
+ - sig: q
178
+ end: big
179
+ buf:
180
+ - 255
181
+ - 255
182
+ val: 65535
183
+ - sig: i
184
+ end: little
185
+ buf:
186
+ - 0
187
+ - 0
188
+ - 0
189
+ - 0
190
+ val: 0
191
+ - sig: i
192
+ end: little
193
+ buf:
194
+ - 255
195
+ - 255
196
+ - 255
197
+ - 127
198
+ val: 2147483647
199
+ - sig: i
200
+ end: little
201
+ buf:
202
+ - 0
203
+ - 0
204
+ - 0
205
+ - 128
206
+ val: -2147483648
207
+ - sig: i
208
+ end: little
209
+ buf:
210
+ - 255
211
+ - 255
212
+ - 255
213
+ - 255
214
+ val: -1
215
+ - sig: i
216
+ end: big
217
+ buf:
218
+ - 0
219
+ - 0
220
+ - 0
221
+ - 0
222
+ val: 0
223
+ - sig: i
224
+ end: big
225
+ buf:
226
+ - 127
227
+ - 255
228
+ - 255
229
+ - 255
230
+ val: 2147483647
231
+ - sig: i
232
+ end: big
233
+ buf:
234
+ - 128
235
+ - 0
236
+ - 0
237
+ - 0
238
+ val: -2147483648
239
+ - sig: i
240
+ end: big
241
+ buf:
242
+ - 255
243
+ - 255
244
+ - 255
245
+ - 255
246
+ val: -1
247
+ - sig: u
248
+ end: little
249
+ buf:
250
+ - 0
251
+ - 0
252
+ - 0
253
+ - 0
254
+ val: 0
255
+ - sig: u
256
+ end: little
257
+ buf:
258
+ - 255
259
+ - 255
260
+ - 255
261
+ - 127
262
+ val: 2147483647
263
+ - sig: u
264
+ end: little
265
+ buf:
266
+ - 0
267
+ - 0
268
+ - 0
269
+ - 128
270
+ val: 2147483648
271
+ - sig: u
272
+ end: little
273
+ buf:
274
+ - 255
275
+ - 255
276
+ - 255
277
+ - 255
278
+ val: 4294967295
279
+ - sig: u
280
+ end: big
281
+ buf:
282
+ - 0
283
+ - 0
284
+ - 0
285
+ - 0
286
+ val: 0
287
+ - sig: u
288
+ end: big
289
+ buf:
290
+ - 127
291
+ - 255
292
+ - 255
293
+ - 255
294
+ val: 2147483647
295
+ - sig: u
296
+ end: big
297
+ buf:
298
+ - 128
299
+ - 0
300
+ - 0
301
+ - 0
302
+ val: 2147483648
303
+ - sig: u
304
+ end: big
305
+ buf:
306
+ - 255
307
+ - 255
308
+ - 255
309
+ - 255
310
+ val: 4294967295
311
+ - sig: h
312
+ end: little
313
+ buf:
314
+ - 0
315
+ - 0
316
+ - 0
317
+ - 0
318
+ val: 0
319
+ - sig: h
320
+ end: little
321
+ buf:
322
+ - 255
323
+ - 255
324
+ - 255
325
+ - 127
326
+ val: 2147483647
327
+ - sig: h
328
+ end: little
329
+ buf:
330
+ - 0
331
+ - 0
332
+ - 0
333
+ - 128
334
+ val: 2147483648
335
+ - sig: h
336
+ end: little
337
+ buf:
338
+ - 255
339
+ - 255
340
+ - 255
341
+ - 255
342
+ val: 4294967295
343
+ - sig: h
344
+ end: big
345
+ buf:
346
+ - 0
347
+ - 0
348
+ - 0
349
+ - 0
350
+ val: 0
351
+ - sig: h
352
+ end: big
353
+ buf:
354
+ - 127
355
+ - 255
356
+ - 255
357
+ - 255
358
+ val: 2147483647
359
+ - sig: h
360
+ end: big
361
+ buf:
362
+ - 128
363
+ - 0
364
+ - 0
365
+ - 0
366
+ val: 2147483648
367
+ - sig: h
368
+ end: big
369
+ buf:
370
+ - 255
371
+ - 255
372
+ - 255
373
+ - 255
374
+ val: 4294967295
375
+ - sig: x
376
+ end: little
377
+ buf:
378
+ - 0
379
+ - 0
380
+ - 0
381
+ - 0
382
+ - 0
383
+ - 0
384
+ - 0
385
+ - 0
386
+ val: 0
387
+ - sig: x
388
+ end: little
389
+ buf:
390
+ - 255
391
+ - 255
392
+ - 255
393
+ - 255
394
+ - 255
395
+ - 255
396
+ - 255
397
+ - 127
398
+ val: 9223372036854775807
399
+ - sig: x
400
+ end: little
401
+ buf:
402
+ - 0
403
+ - 0
404
+ - 0
405
+ - 0
406
+ - 0
407
+ - 0
408
+ - 0
409
+ - 128
410
+ val: -9223372036854775808
411
+ - sig: x
412
+ end: little
413
+ buf:
414
+ - 255
415
+ - 255
416
+ - 255
417
+ - 255
418
+ - 255
419
+ - 255
420
+ - 255
421
+ - 255
422
+ val: -1
423
+ - sig: x
424
+ end: big
425
+ buf:
426
+ - 0
427
+ - 0
428
+ - 0
429
+ - 0
430
+ - 0
431
+ - 0
432
+ - 0
433
+ - 0
434
+ val: 0
435
+ - sig: x
436
+ end: big
437
+ buf:
438
+ - 127
439
+ - 255
440
+ - 255
441
+ - 255
442
+ - 255
443
+ - 255
444
+ - 255
445
+ - 255
446
+ val: 9223372036854775807
447
+ - sig: x
448
+ end: big
449
+ buf:
450
+ - 128
451
+ - 0
452
+ - 0
453
+ - 0
454
+ - 0
455
+ - 0
456
+ - 0
457
+ - 0
458
+ val: -9223372036854775808
459
+ - sig: x
460
+ end: big
461
+ buf:
462
+ - 255
463
+ - 255
464
+ - 255
465
+ - 255
466
+ - 255
467
+ - 255
468
+ - 255
469
+ - 255
470
+ val: -1
471
+ - sig: t
472
+ end: little
473
+ buf:
474
+ - 0
475
+ - 0
476
+ - 0
477
+ - 0
478
+ - 0
479
+ - 0
480
+ - 0
481
+ - 0
482
+ val: 0
483
+ - sig: t
484
+ end: little
485
+ buf:
486
+ - 255
487
+ - 255
488
+ - 255
489
+ - 255
490
+ - 255
491
+ - 255
492
+ - 255
493
+ - 127
494
+ val: 9223372036854775807
495
+ - sig: t
496
+ end: little
497
+ buf:
498
+ - 0
499
+ - 0
500
+ - 0
501
+ - 0
502
+ - 0
503
+ - 0
504
+ - 0
505
+ - 128
506
+ val: 9223372036854775808
507
+ - sig: t
508
+ end: little
509
+ buf:
510
+ - 255
511
+ - 255
512
+ - 255
513
+ - 255
514
+ - 255
515
+ - 255
516
+ - 255
517
+ - 255
518
+ val: 18446744073709551615
519
+ - sig: t
520
+ end: big
521
+ buf:
522
+ - 0
523
+ - 0
524
+ - 0
525
+ - 0
526
+ - 0
527
+ - 0
528
+ - 0
529
+ - 0
530
+ val: 0
531
+ - sig: t
532
+ end: big
533
+ buf:
534
+ - 127
535
+ - 255
536
+ - 255
537
+ - 255
538
+ - 255
539
+ - 255
540
+ - 255
541
+ - 255
542
+ val: 9223372036854775807
543
+ - sig: t
544
+ end: big
545
+ buf:
546
+ - 128
547
+ - 0
548
+ - 0
549
+ - 0
550
+ - 0
551
+ - 0
552
+ - 0
553
+ - 0
554
+ val: 9223372036854775808
555
+ - sig: t
556
+ end: big
557
+ buf:
558
+ - 255
559
+ - 255
560
+ - 255
561
+ - 255
562
+ - 255
563
+ - 255
564
+ - 255
565
+ - 255
566
+ val: 18446744073709551615
567
+ - sig: d
568
+ end: little
569
+ buf:
570
+ - 0
571
+ - 0
572
+ - 0
573
+ - 0
574
+ - 0
575
+ - 0
576
+ - 0
577
+ - 0
578
+ val: 0.0
579
+ - sig: d
580
+ end: little
581
+ buf:
582
+ - 0
583
+ - 0
584
+ - 0
585
+ - 0
586
+ - 0
587
+ - 0
588
+ - 0
589
+ - 128
590
+ val: -0.0
591
+ - sig: d
592
+ end: little
593
+ buf:
594
+ - 0
595
+ - 0
596
+ - 0
597
+ - 0
598
+ - 0
599
+ - 0
600
+ - 0
601
+ - "@"
602
+ val: 2.0
603
+ - sig: d
604
+ end: big
605
+ buf:
606
+ - 0
607
+ - 0
608
+ - 0
609
+ - 0
610
+ - 0
611
+ - 0
612
+ - 0
613
+ - 0
614
+ val: 0.0
615
+ - sig: d
616
+ end: big
617
+ buf:
618
+ - 128
619
+ - 0
620
+ - 0
621
+ - 0
622
+ - 0
623
+ - 0
624
+ - 0
625
+ - 0
626
+ val: -0.0
627
+ - sig: d
628
+ end: big
629
+ buf:
630
+ - "@"
631
+ - 0
632
+ - 0
633
+ - 0
634
+ - 0
635
+ - 0
636
+ - 0
637
+ - 0
638
+ val: 2.0
639
+ - sig: s
640
+ end: little
641
+ buf:
642
+ - 0
643
+ - 0
644
+ - 0
645
+ - 0
646
+ - 0
647
+ val: ''
648
+ - sig: s
649
+ end: little
650
+ buf:
651
+ - 2
652
+ - 0
653
+ - 0
654
+ - 0
655
+ - 197
656
+ - 152
657
+ - 0
658
+ val: Ř
659
+ - sig: s
660
+ end: little
661
+ buf:
662
+ - 3
663
+ - 0
664
+ - 0
665
+ - 0
666
+ - 239
667
+ - 191
668
+ - 191
669
+ - 0
670
+ val: "\uFFFF"
671
+ - sig: s
672
+ end: big
673
+ buf:
674
+ - 0
675
+ - 0
676
+ - 0
677
+ - 0
678
+ - 0
679
+ val: ''
680
+ - sig: s
681
+ end: big
682
+ buf:
683
+ - 0
684
+ - 0
685
+ - 0
686
+ - 2
687
+ - 197
688
+ - 152
689
+ - 0
690
+ val: Ř
691
+ - sig: s
692
+ end: big
693
+ buf:
694
+ - 0
695
+ - 0
696
+ - 0
697
+ - 3
698
+ - 239
699
+ - 191
700
+ - 191
701
+ - 0
702
+ val: "\uFFFF"
703
+ - sig: s
704
+ end: big
705
+ buf:
706
+ - 0
707
+ - 0
708
+ - 0
709
+ - 4
710
+ - 244
711
+ - 143
712
+ - 191
713
+ - 191
714
+ - 0
715
+ val: "\U0010FFFF"
716
+ - sig: s
717
+ end: little
718
+ buf:
719
+ - 0
720
+ - 0
721
+ - 0
722
+ - 0
723
+ - U
724
+ exc: DBus::InvalidPacketException
725
+ msg: not NUL-terminated
726
+ - sig: s
727
+ end: little
728
+ buf:
729
+ - 1
730
+ - 0
731
+ - 0
732
+ - 0
733
+ - "@U"
734
+ exc: DBus::InvalidPacketException
735
+ msg: not NUL-terminated
736
+ - sig: s
737
+ end: little
738
+ buf:
739
+ - 0
740
+ - 0
741
+ - 0
742
+ - 0
743
+ exc: DBus::IncompleteBufferException
744
+ msg: ''
745
+ - sig: s
746
+ end: little
747
+ buf:
748
+ - 0
749
+ - 0
750
+ - 0
751
+ exc: DBus::IncompleteBufferException
752
+ msg: ''
753
+ - sig: s
754
+ end: little
755
+ buf:
756
+ - 0
757
+ - 0
758
+ exc: DBus::IncompleteBufferException
759
+ msg: ''
760
+ - sig: s
761
+ end: little
762
+ buf:
763
+ - 0
764
+ exc: DBus::IncompleteBufferException
765
+ msg: ''
766
+ # NUL in the middle
767
+ - sig: s
768
+ end: little
769
+ buf:
770
+ - 3
771
+ - 0
772
+ - 0
773
+ - 0
774
+ - a
775
+ - 0
776
+ - b
777
+ - 0
778
+ exc: DBus::InvalidPacketException
779
+ msg: Invalid string
780
+ # invalid UTF-8
781
+ - sig: s
782
+ end: little
783
+ buf:
784
+ - 4
785
+ - 0
786
+ - 0
787
+ - 0
788
+ - 255
789
+ - 255
790
+ - 255
791
+ - 255
792
+ - 0
793
+ exc: DBus::InvalidPacketException
794
+ msg: Invalid string
795
+ # overlong sequence encoding an "A"
796
+ - sig: s
797
+ end: little
798
+ buf:
799
+ - 2
800
+ - 0
801
+ - 0
802
+ - 0
803
+ - 0xC1
804
+ - 0x81
805
+ - 0
806
+ exc: DBus::InvalidPacketException
807
+ msg: Invalid string
808
+ # first codepoint outside UTF-8, U+110000
809
+ - sig: s
810
+ end: little
811
+ buf:
812
+ - 4
813
+ - 0
814
+ - 0
815
+ - 0
816
+ - 0xF4
817
+ - 0x90
818
+ - 0xC0
819
+ - 0xC0
820
+ - 0
821
+ exc: DBus::InvalidPacketException
822
+ msg: Invalid string
823
+ - sig: o
824
+ end: little
825
+ buf:
826
+ - 1
827
+ - 0
828
+ - 0
829
+ - 0
830
+ - "/"
831
+ - 0
832
+ val: "/"
833
+ - sig: o
834
+ end: little
835
+ buf:
836
+ - 32
837
+ - 0
838
+ - 0
839
+ - 0
840
+ - "/99Numbers/_And_Underscores/anyw"
841
+ - 0
842
+ val: "/99Numbers/_And_Underscores/anyw"
843
+ # no size limit like for other names; 512 characters are fine
844
+ - sig: o
845
+ end: little
846
+ buf:
847
+ - [0, 2, 0, 0]
848
+ - "/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
849
+ - "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
850
+ - "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
851
+ - "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
852
+ - "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
853
+ - "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
854
+ - "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
855
+ - "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
856
+ - 0
857
+ val: "/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
858
+ - sig: o
859
+ end: big
860
+ buf:
861
+ - 0
862
+ - 0
863
+ - 0
864
+ - 1
865
+ - "/"
866
+ - 0
867
+ val: "/"
868
+ - sig: o
869
+ end: big
870
+ buf:
871
+ - 0
872
+ - 0
873
+ - 0
874
+ - " /99Numbers/_And_Underscores/anyw"
875
+ - 0
876
+ val: "/99Numbers/_And_Underscores/anyw"
877
+ - sig: o
878
+ end: little
879
+ buf:
880
+ - 0
881
+ - 0
882
+ - 0
883
+ - 0
884
+ - U
885
+ exc: DBus::InvalidPacketException
886
+ msg: not NUL-terminated
887
+ - sig: o
888
+ end: little
889
+ buf:
890
+ - 1
891
+ - 0
892
+ - 0
893
+ - 0
894
+ - "/U"
895
+ exc: DBus::InvalidPacketException
896
+ msg: not NUL-terminated
897
+ - sig: o
898
+ end: little
899
+ buf:
900
+ - 0
901
+ - 0
902
+ - 0
903
+ - 0
904
+ exc: DBus::IncompleteBufferException
905
+ msg: ''
906
+ - sig: o
907
+ end: little
908
+ buf:
909
+ - 0
910
+ - 0
911
+ - 0
912
+ exc: DBus::IncompleteBufferException
913
+ msg: ''
914
+ - sig: o
915
+ end: little
916
+ buf:
917
+ - 0
918
+ - 0
919
+ exc: DBus::IncompleteBufferException
920
+ msg: ''
921
+ - sig: o
922
+ end: little
923
+ buf:
924
+ - 0
925
+ exc: DBus::IncompleteBufferException
926
+ msg: ''
927
+ - sig: o
928
+ end: little
929
+ buf:
930
+ - 0
931
+ - 0
932
+ - 0
933
+ - 0
934
+ - 0
935
+ exc: DBus::InvalidPacketException
936
+ msg: Invalid object path
937
+ - sig: o
938
+ end: big
939
+ buf:
940
+ - 0
941
+ - 0
942
+ - 0
943
+ - 0
944
+ - 0
945
+ exc: DBus::InvalidPacketException
946
+ msg: Invalid object path
947
+ - sig: o
948
+ end: big
949
+ buf:
950
+ - 0
951
+ - 0
952
+ - 0
953
+ - 5
954
+ - "/_//_"
955
+ - 0
956
+ exc: DBus::InvalidPacketException
957
+ msg: Invalid object path
958
+ - sig: o
959
+ end: big
960
+ buf:
961
+ - 0
962
+ - 0
963
+ - 0
964
+ - 5
965
+ - "/_/_/"
966
+ - 0
967
+ exc: DBus::InvalidPacketException
968
+ msg: Invalid object path
969
+ - sig: o
970
+ end: big
971
+ buf:
972
+ - 0
973
+ - 0
974
+ - 0
975
+ - 5
976
+ - "/_/_ "
977
+ - 0
978
+ exc: DBus::InvalidPacketException
979
+ msg: Invalid object path
980
+ - sig: o
981
+ end: big
982
+ buf:
983
+ - 0
984
+ - 0
985
+ - 0
986
+ - 5
987
+ - "/_/_-"
988
+ - 0
989
+ exc: DBus::InvalidPacketException
990
+ msg: Invalid object path
991
+ # NUL in the middle
992
+ - sig: o
993
+ end: big
994
+ buf:
995
+ - 0
996
+ - 0
997
+ - 0
998
+ - 5
999
+ - "/_/_"
1000
+ - 0
1001
+ - 0
1002
+ exc: DBus::InvalidPacketException
1003
+ msg: Invalid object path
1004
+ # accented a
1005
+ - sig: o
1006
+ end: big
1007
+ buf:
1008
+ - 0
1009
+ - 0
1010
+ - 0
1011
+ - 5
1012
+ - "/_/"
1013
+ - 195
1014
+ - 161
1015
+ - 0
1016
+ exc: DBus::InvalidPacketException
1017
+ msg: Invalid object path
1018
+ - sig: g
1019
+ end: little
1020
+ buf:
1021
+ - 0
1022
+ - 0
1023
+ val: ''
1024
+ - sig: g
1025
+ end: big
1026
+ buf:
1027
+ - 0
1028
+ - 0
1029
+ val: ''
1030
+ - sig: g
1031
+ end: little
1032
+ buf:
1033
+ - 1
1034
+ - b
1035
+ - 0
1036
+ val: b
1037
+ - sig: g
1038
+ end: big
1039
+ buf:
1040
+ - 1
1041
+ - b
1042
+ - 0
1043
+ val: b
1044
+ - sig: g
1045
+ end: big
1046
+ buf:
1047
+ - 0
1048
+ - U
1049
+ exc: DBus::InvalidPacketException
1050
+ msg: not NUL-terminated
1051
+ - sig: g
1052
+ end: big
1053
+ buf:
1054
+ - 1
1055
+ - bU
1056
+ exc: DBus::InvalidPacketException
1057
+ msg: not NUL-terminated
1058
+ - sig: g
1059
+ end: little
1060
+ buf:
1061
+ - 0
1062
+ exc: DBus::IncompleteBufferException
1063
+ msg: ''
1064
+ - sig: g
1065
+ end: big
1066
+ buf:
1067
+ - 1
1068
+ - "!"
1069
+ - 0
1070
+ exc: DBus::InvalidPacketException
1071
+ msg: Invalid signature
1072
+ - sig: g
1073
+ end: big
1074
+ buf:
1075
+ - 1
1076
+ - r
1077
+ - 0
1078
+ exc: DBus::InvalidPacketException
1079
+ msg: Invalid signature
1080
+ - sig: g
1081
+ end: big
1082
+ buf:
1083
+ - 2
1084
+ - ae
1085
+ - 0
1086
+ exc: DBus::InvalidPacketException
1087
+ msg: Invalid signature
1088
+ - sig: g
1089
+ end: big
1090
+ buf:
1091
+ - 1
1092
+ - a
1093
+ - 0
1094
+ exc: DBus::InvalidPacketException
1095
+ msg: Invalid signature
1096
+ # dict_entry with other than 2 members
1097
+ - sig: g
1098
+ end: big
1099
+ buf:
1100
+ - 3
1101
+ - a{}
1102
+ - 0
1103
+ exc: DBus::InvalidPacketException
1104
+ msg: Invalid signature
1105
+ - sig: g
1106
+ end: big
1107
+ buf:
1108
+ - 4
1109
+ - a{s}
1110
+ - 0
1111
+ exc: DBus::InvalidPacketException
1112
+ msg: Invalid signature
1113
+ - sig: g
1114
+ end: big
1115
+ buf:
1116
+ - 6
1117
+ - a{sss}
1118
+ - 0
1119
+ exc: DBus::InvalidPacketException
1120
+ msg: Invalid signature
1121
+ # dict_entry with non-basic key
1122
+ - sig: g
1123
+ end: big
1124
+ buf:
1125
+ - 5
1126
+ - a{vs}
1127
+ - 0
1128
+ exc: DBus::InvalidPacketException
1129
+ msg: Invalid signature
1130
+ # dict_entry outside array
1131
+ - sig: g
1132
+ end: big
1133
+ buf:
1134
+ - 4
1135
+ - "{sv}"
1136
+ - 0
1137
+ exc: DBus::InvalidPacketException
1138
+ msg: Invalid signature
1139
+ # dict_entry not immediately in an array
1140
+ - sig: g
1141
+ end: big
1142
+ buf:
1143
+ - 7
1144
+ - a({sv})
1145
+ - 0
1146
+ exc: DBus::InvalidPacketException
1147
+ msg: Invalid signature
1148
+ # NUL in the middle
1149
+ - sig: g
1150
+ end: big
1151
+ buf:
1152
+ - 3
1153
+ - a
1154
+ - 0
1155
+ - "y"
1156
+ - 0
1157
+ exc: DBus::InvalidPacketException
1158
+ msg: Invalid signature
1159
+
1160
+ # ARRAYs
1161
+
1162
+ # marshalling format:
1163
+ # - (alignment of data_bytes)
1164
+ # - UINT32 data_bytes (without any alignment padding)
1165
+ # - (alignment of ITEM_TYPE, even if the array is empty)
1166
+ # - ITEM_TYPE item1
1167
+ # - (alignment of ITEM_TYPE)
1168
+ # - ITEM_TYPE item2...
1169
+
1170
+ # Here we repeat the STRINGs test data (without the trailing NUL)
1171
+ # but the outcomes are different
1172
+ - sig: ay
1173
+ end: little
1174
+ buf:
1175
+ - 0
1176
+ - 0
1177
+ - 0
1178
+ - 0
1179
+ val: []
1180
+ - sig: ay
1181
+ end: little
1182
+ buf:
1183
+ - 2
1184
+ - 0
1185
+ - 0
1186
+ - 0
1187
+ - 197
1188
+ - 152
1189
+ val:
1190
+ - 197
1191
+ - 152
1192
+ - sig: ay
1193
+ end: little
1194
+ buf:
1195
+ - 3
1196
+ - 0
1197
+ - 0
1198
+ - 0
1199
+ - 239
1200
+ - 191
1201
+ - 191
1202
+ val:
1203
+ - 239
1204
+ - 191
1205
+ - 191
1206
+ - sig: ay
1207
+ end: big
1208
+ buf:
1209
+ - 0
1210
+ - 0
1211
+ - 0
1212
+ - 0
1213
+ val: []
1214
+ - sig: ay
1215
+ end: big
1216
+ buf:
1217
+ - 0
1218
+ - 0
1219
+ - 0
1220
+ - 2
1221
+ - 197
1222
+ - 152
1223
+ val:
1224
+ - 197
1225
+ - 152
1226
+ - sig: ay
1227
+ end: big
1228
+ buf:
1229
+ - 0
1230
+ - 0
1231
+ - 0
1232
+ - 3
1233
+ - 239
1234
+ - 191
1235
+ - 191
1236
+ val:
1237
+ - 239
1238
+ - 191
1239
+ - 191
1240
+ - sig: ay
1241
+ end: big
1242
+ buf:
1243
+ - 0
1244
+ - 0
1245
+ - 0
1246
+ - 4
1247
+ - 244
1248
+ - 143
1249
+ - 191
1250
+ - 191
1251
+ val:
1252
+ - 244
1253
+ - 143
1254
+ - 191
1255
+ - 191
1256
+ - sig: ay
1257
+ end: little
1258
+ buf:
1259
+ - 3
1260
+ - 0
1261
+ - 0
1262
+ - 0
1263
+ - a
1264
+ - 0
1265
+ - b
1266
+ val:
1267
+ - 97
1268
+ - 0
1269
+ - 98
1270
+ - sig: ay
1271
+ end: little
1272
+ buf:
1273
+ - 4
1274
+ - 0
1275
+ - 0
1276
+ - 0
1277
+ - 255
1278
+ - 255
1279
+ - 255
1280
+ - 255
1281
+ val:
1282
+ - 255
1283
+ - 255
1284
+ - 255
1285
+ - 255
1286
+ - sig: ay
1287
+ end: little
1288
+ buf:
1289
+ - 2
1290
+ - 0
1291
+ - 0
1292
+ - 0
1293
+ - 193
1294
+ - 129
1295
+ val:
1296
+ - 193
1297
+ - 129
1298
+ - sig: ay
1299
+ end: little
1300
+ buf:
1301
+ - 4
1302
+ - 0
1303
+ - 0
1304
+ - 0
1305
+ - 244
1306
+ - 144
1307
+ - 192
1308
+ - 192
1309
+ val:
1310
+ - 244
1311
+ - 144
1312
+ - 192
1313
+ - 192
1314
+
1315
+ # With basic types, by the time we have found the message to be invalid,
1316
+ # it is nevertheless well-formed and we could read the next message.
1317
+ # However, an overlong array (body longer than 64MiB) is a good enough
1318
+ # reason to drop the connection, which is what InvalidPacketException
1319
+ # does, right? Doesn't it?
1320
+ # Well it does, by crashing the entire process.
1321
+ # That should be made more graceful.
1322
+ - sig: ay
1323
+ end: little
1324
+ buf:
1325
+ - 1
1326
+ - 0
1327
+ - 0
1328
+ - 4
1329
+ exc: DBus::InvalidPacketException
1330
+ msg: ARRAY body longer than 64MiB
1331
+ - sig: ay
1332
+ end: little
1333
+ buf:
1334
+ - 2
1335
+ - 0
1336
+ - 0
1337
+ - 0
1338
+ - 170
1339
+ exc: DBus::IncompleteBufferException
1340
+ msg: ''
1341
+ - sig: ay
1342
+ end: little
1343
+ buf:
1344
+ - 0
1345
+ - 0
1346
+ - 0
1347
+ exc: DBus::IncompleteBufferException
1348
+ msg: ''
1349
+ - sig: ay
1350
+ end: little
1351
+ buf:
1352
+ - 0
1353
+ - 0
1354
+ exc: DBus::IncompleteBufferException
1355
+ msg: ''
1356
+ - sig: ay
1357
+ end: little
1358
+ buf:
1359
+ - 0
1360
+ exc: DBus::IncompleteBufferException
1361
+ msg: ''
1362
+ - sig: at
1363
+ end: little
1364
+ buf:
1365
+ # body size
1366
+ - [0, 0, 0, 0]
1367
+ # padding
1368
+ - [0, 0, 0, 0]
1369
+ val: []
1370
+ - sig: at
1371
+ end: little
1372
+ buf:
1373
+ # body size
1374
+ - [16, 0, 0, 0]
1375
+ # padding
1376
+ - [0, 0, 0, 0]
1377
+ # item
1378
+ - [1, 0, 0, 0, 0, 0, 0, 0]
1379
+ # item
1380
+ - [2, 0, 0, 0, 0, 0, 0, 0]
1381
+ val:
1382
+ - 1
1383
+ - 2
1384
+ - sig: at
1385
+ end: little
1386
+ buf:
1387
+ # body size, missing padding
1388
+ - [0, 0, 0, 0]
1389
+ exc: DBus::IncompleteBufferException
1390
+ msg: ''
1391
+ - sig: at
1392
+ end: little
1393
+ buf:
1394
+ # body size
1395
+ - [0, 0, 0, 0]
1396
+ # nonzero padding
1397
+ - [0xDE, 0xAD, 0xBE, 0xEF]
1398
+ exc: DBus::InvalidPacketException
1399
+ msg: ''
1400
+ - sig: at
1401
+ end: little
1402
+ buf:
1403
+ # body size
1404
+ - [8, 0, 0, 0]
1405
+ # padding
1406
+ - [0, 0, 0, 0]
1407
+ # incomplete item
1408
+ - 170
1409
+ exc: DBus::IncompleteBufferException
1410
+ msg: ''
1411
+
1412
+ # arrays of nontrivial types let us demonstrate the padding of their elements
1413
+ - sig: a(qq)
1414
+ end: little
1415
+ buf:
1416
+ # body size
1417
+ - [0, 0, 0, 0]
1418
+ # padding
1419
+ - [0, 0, 0, 0]
1420
+ val: []
1421
+ - sig: a(qq)
1422
+ end: little
1423
+ buf:
1424
+ # body size
1425
+ - [12, 0, 0, 0]
1426
+ # padding
1427
+ - [0, 0, 0, 0]
1428
+ # item
1429
+ - [1, 0, 2, 0]
1430
+ # padding
1431
+ - [0, 0, 0, 0]
1432
+ # item
1433
+ - [3, 0, 4, 0]
1434
+ val:
1435
+ - - 1
1436
+ - 2
1437
+ - - 3
1438
+ - 4
1439
+ # This illustrates that the specification is wrong in asserting that
1440
+ # the body size is divisible by the item count
1441
+ - sig: a(qq)
1442
+ end: little
1443
+ buf:
1444
+ # body size
1445
+ - [20, 0, 0, 0]
1446
+ # padding
1447
+ - [0, 0, 0, 0]
1448
+ # item
1449
+ - [5, 0, 6, 0]
1450
+ # padding
1451
+ - [0, 0, 0, 0]
1452
+ # item
1453
+ - [7, 0, 8, 0]
1454
+ # padding
1455
+ - [0, 0, 0, 0]
1456
+ # item
1457
+ - [9, 0, 10, 0]
1458
+ val:
1459
+ - - 5
1460
+ - 6
1461
+ - - 7
1462
+ - 8
1463
+ - - 9
1464
+ - 10
1465
+ - sig: a(qq)
1466
+ end: little
1467
+ buf:
1468
+ # body size, missing padding
1469
+ - [0, 0, 0, 0]
1470
+ exc: DBus::IncompleteBufferException
1471
+ msg: ''
1472
+ - sig: a(qq)
1473
+ end: little
1474
+ buf:
1475
+ # body size
1476
+ - [0, 0, 0, 0]
1477
+ # nonzero padding
1478
+ - [0xDE, 0xAD, 0xBE, 0xEF]
1479
+ exc: DBus::InvalidPacketException
1480
+ msg: ''
1481
+ - sig: a{yq}
1482
+ end: little
1483
+ buf:
1484
+ # body size
1485
+ - [0, 0, 0, 0]
1486
+ # padding
1487
+ - [0, 0, 0, 0]
1488
+ val: {}
1489
+ - sig: a{yq}
1490
+ end: little
1491
+ buf:
1492
+ # body size
1493
+ - [12, 0, 0, 0]
1494
+ # dict_entry padding
1495
+ - [0, 0, 0, 0]
1496
+ # key, padding, value
1497
+ - [1, 0, 2, 0]
1498
+ # dict_entry padding
1499
+ - [0, 0, 0, 0]
1500
+ # key, padding, value
1501
+ - [3, 0, 4, 0]
1502
+ val:
1503
+ 1: 2
1504
+ 3: 4
1505
+ - sig: a{yq}
1506
+ end: big
1507
+ buf:
1508
+ # body size
1509
+ - [0, 0, 0, 12]
1510
+ # dict_entry padding
1511
+ - [0, 0, 0, 0]
1512
+ # key, padding, value
1513
+ - [1, 0, 0, 2]
1514
+ # dict_entry padding
1515
+ - [0, 0, 0, 0]
1516
+ # key, padding, value
1517
+ - [3, 0, 0, 4]
1518
+ val:
1519
+ 1: 2
1520
+ 3: 4
1521
+ - sig: a{yq}
1522
+ end: little
1523
+ buf:
1524
+ # body size, missing padding
1525
+ - [0, 0, 0, 0]
1526
+ exc: DBus::IncompleteBufferException
1527
+ msg: ''
1528
+ - sig: a{yq}
1529
+ end: little
1530
+ buf:
1531
+ # body size
1532
+ - [0, 0, 0, 0]
1533
+ # nonzero padding
1534
+ - [0xDE, 0xAD, 0xBE, 0xEF]
1535
+ exc: DBus::InvalidPacketException
1536
+ msg: ''
1537
+ - sig: "(qq)"
1538
+ end: little
1539
+ buf:
1540
+ - 1
1541
+ - 0
1542
+ - 2
1543
+ - 0
1544
+ val:
1545
+ - 1
1546
+ - 2
1547
+ - sig: "(qq)"
1548
+ end: big
1549
+ buf:
1550
+ - 0
1551
+ - 3
1552
+ - 0
1553
+ - 4
1554
+ val:
1555
+ - 3
1556
+ - 4
1557
+ - sig: v
1558
+ end: little
1559
+ buf:
1560
+ # signature
1561
+ - [1, "y", 0]
1562
+ # value
1563
+ - 255
1564
+ val: 255
1565
+ marshall: false
1566
+ - sig: v
1567
+ end: little
1568
+ buf:
1569
+ # signature
1570
+ - [1, "u", 0]
1571
+ # padding
1572
+ - 0
1573
+ # value
1574
+ - [1, 0, 0, 0]
1575
+ val: 1
1576
+ marshall: false
1577
+ # nested variant
1578
+ - sig: v
1579
+ end: little
1580
+ buf:
1581
+ # signature
1582
+ - [1, "v", 0]
1583
+ # value:
1584
+ # signature
1585
+ - [1, "y", 0]
1586
+ # value
1587
+ - 255
1588
+ val: 255
1589
+ marshall: false
1590
+ # the signature has no type
1591
+ - sig: v
1592
+ end: little
1593
+ buf:
1594
+ # signature
1595
+ - [0, 0]
1596
+ exc: DBus::InvalidPacketException
1597
+ msg: 1 value, 0 found
1598
+ # the signature has more than one type
1599
+ - sig: v
1600
+ end: little
1601
+ buf:
1602
+ # signature
1603
+ - [2, "yy", 0]
1604
+ # data
1605
+ - 255
1606
+ - 255
1607
+ exc: DBus::InvalidPacketException
1608
+ msg: 1 value, 2 found
1609
+ # a variant nested 69 levels
1610
+ - sig: v
1611
+ end: little
1612
+ buf:
1613
+ - [1, "v", 0, 1, "v", 0, 1, "v", 0, 1, "v", 0]
1614
+ - [1, "v", 0, 1, "v", 0, 1, "v", 0, 1, "v", 0]
1615
+ - [1, "v", 0, 1, "v", 0, 1, "v", 0, 1, "v", 0]
1616
+ - [1, "v", 0, 1, "v", 0, 1, "v", 0, 1, "v", 0]
1617
+
1618
+ - [1, "v", 0, 1, "v", 0, 1, "v", 0, 1, "v", 0]
1619
+ - [1, "v", 0, 1, "v", 0, 1, "v", 0, 1, "v", 0]
1620
+ - [1, "v", 0, 1, "v", 0, 1, "v", 0, 1, "v", 0]
1621
+ - [1, "v", 0, 1, "v", 0, 1, "v", 0, 1, "v", 0]
1622
+
1623
+ - [1, "v", 0, 1, "v", 0, 1, "v", 0, 1, "v", 0]
1624
+ - [1, "v", 0, 1, "v", 0, 1, "v", 0, 1, "v", 0]
1625
+ - [1, "v", 0, 1, "v", 0, 1, "v", 0, 1, "v", 0]
1626
+ - [1, "v", 0, 1, "v", 0, 1, "v", 0, 1, "v", 0]
1627
+
1628
+ - [1, "v", 0, 1, "v", 0, 1, "v", 0, 1, "v", 0]
1629
+ - [1, "v", 0, 1, "v", 0, 1, "v", 0, 1, "v", 0]
1630
+ - [1, "v", 0, 1, "v", 0, 1, "v", 0, 1, "v", 0]
1631
+ - [1, "v", 0, 1, "v", 0, 1, "v", 0, 1, "v", 0]
1632
+
1633
+ - [1, "v", 0, 1, "v", 0, 1, "v", 0, 1, "v", 0]
1634
+
1635
+ - [1, "y", 0]
1636
+ - 255
1637
+ exc: DBus::InvalidPacketException
1638
+ msg: nested too deep
1639
+ unmarshall: false