|
34 | 34 |
|
35 | 35 | define test binary-data-parser () |
36 | 36 | let frame = parse-frame(<test-protocol>, #(#x23, #x42)); |
| 37 | + assert-equal(frame.foo, #x23); |
| 38 | + assert-equal(frame.bar, #x42); |
37 | 39 | let field-list = fields(frame); |
38 | 40 | static-checker(field-list[0], 0, 8, 8); |
39 | 41 | static-checker(field-list[1], 8, 8, 16); |
|
62 | 64 |
|
63 | 65 | define test binary-data-dynamic-parser () |
64 | 66 | let frame = parse-frame(<dynamic-test>, #(#x2, #x0, #x0, #x3, #x4, #x5)); |
| 67 | + assert-equal(frame.foobar, #x2); |
| 68 | + |
| 69 | + // payload starts at foobar = 2 bytes into the frame so first 0 byte ignored. |
| 70 | + assert-equal(bd/data(frame.payload), #(#x0, #x3, #x4, #x5)); |
| 71 | + |
65 | 72 | let field-list = fields(frame); |
66 | 73 | static-checker(field-list[0], 0, 8, 8); |
67 | 74 | static-checker(field-list[1], $unknown-at-compile-time, $unknown-at-compile-time, $unknown-at-compile-time); |
|
87 | 94 | define test static-start-test () |
88 | 95 | let frame = parse-frame(<static-start-frame>, #(#x3, #x4, #x5, #x6)); |
89 | 96 | let field-list = fields(frame); |
| 97 | + assert-equal(frame.a, #x3); |
| 98 | + // static-start at 24 bits means #x4 and #x5 are skipped. |
| 99 | + assert-equal(bd/data(frame.b), #(#x6)); |
90 | 100 | static-checker(field-list[0], 0, 8, 8); |
91 | 101 | static-checker(field-list[1], 24, $unknown-at-compile-time, $unknown-at-compile-time); |
92 | 102 | frame-field-checker(0, frame, 0, 8, 8); |
|
0 commit comments