Skip to content

Commit 1dca2b9

Browse files
committed
Fix expected encoded integers
Makes the format consistent (hex), and updated based on various sample sources.
1 parent 7744f7f commit 1dca2b9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

test/ber/test_ber.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,20 @@ def test_false
2929
128 => "\x02\x02\x00\x80",
3030
255 => "\x02\x02\x00\xFF",
3131
256 => "\x02\x02\x01\x00",
32-
65535 => "\x02\x02\xFF\xFF",
32+
65535 => "\x02\x03\x00\xFF\xFF",
3333
65536 => "\x02\x03\x01\x00\x00",
34-
16_777_215 => "\x02\x03\xFF\xFF\xFF",
34+
8388607 => "\x02\x03\x7F\xFF\xFF",
35+
8388608 => "\x02\x04\x00\x80\x00\x00",
36+
16_777_215 => "\x02\x04\x00\xFF\xFF\xFF",
3537
0x01000000 => "\x02\x04\x01\x00\x00\x00",
3638
0x3FFFFFFF => "\x02\x04\x3F\xFF\xFF\xFF",
3739
0x4FFFFFFF => "\x02\x04\x4F\xFF\xFF\xFF",
3840

3941
# Some odd samples...
40-
5 => "\002\001\005",
41-
500 => "\002\002\001\364",
42-
50_000 => "\x02\x02\xC3P",
43-
5_000_000_000 => "\002\005\001*\005\362\000",
42+
5 => "\x02\x01\x05",
43+
500 => "\x02\x02\x01\xf4",
44+
50_000 => "\x02\x03\x00\xC3\x50",
45+
5_000_000_000 => "\x02\x05\x01\x2a\x05\xF2\x00",
4446

4547
# negatives
4648
# -1 => "\x02\x01\xFF",

0 commit comments

Comments
 (0)