-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Source files for brogen to generate good and bad streams.
gen is a shell script that runs all of the source files through brogen and deb.
- Loading branch information
Showing
28 changed files
with
239 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# premature end of input when getting bits in metadata header | ||
w last m 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# oversubscribed complex code length code | ||
w last m 6 | ||
types 1 | ||
types 1 | ||
types 1 | ||
b 2 0 b 4 2 | ||
b 2 0 | ||
b 1 0 b 1 0 | ||
b 2 0 | ||
len 2 | ||
len 1 | ||
len 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# incomplete complex code length code | ||
w last m 6 | ||
types 1 | ||
types 1 | ||
types 1 | ||
b 2 0 b 4 2 | ||
b 2 0 | ||
b 1 0 b 1 0 | ||
b 2 0 | ||
len 0 | ||
len 0 | ||
len 0 | ||
len 0 | ||
len 0 | ||
len 0 | ||
len 0 | ||
len 0 | ||
len 0 | ||
len 0 | ||
len 0 | ||
len 0 | ||
len 0 | ||
len 0 | ||
len 0 | ||
len 0 | ||
len 0 | ||
len 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# leftover bits in last byte at end of stream not all zero | ||
w e -1 bound 0x7f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# provided symbol exceeds alphabet size in a simple code | ||
w last m 6 | ||
types 3 | ||
s 0 1 3 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# incomplete complex code | ||
w last m 6 | ||
types 3 # five symbols | ||
b 2 2 # complex code, skip 2 | ||
len 1 # len 3 (0) | ||
len 1 # len 4 (1) | ||
b 1 0 # all five symbols are three bits | ||
b 1 0 | ||
b 1 0 | ||
b 1 0 | ||
b 1 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# premature end of input in metadata | ||
w e 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# bits skipped to get to byte boundary for metadata not all zeros | ||
w e bound 0x7f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Request a longer copy than the remaining metablock size | ||
w last m 2 # metablock size 2 | ||
types 1 # NBLTYPESL | ||
types 1 # NBLTYPESI | ||
types 1 # NBLTYPESD | ||
b 2 0 b 4 0 # NPOSTFIX = 0, NDIRECT = 0 | ||
b 2 0 # context mode for the single literal block type | ||
types 1 # NTREESL | ||
types 1 # NTREESD | ||
s 0 1 8 0 # literal code with one symbol (0) | ||
s 1 1 10 136 # IaC code with one symbol (136) | ||
s 2 1 6 16 # one distance code (16) | ||
p 1 136 # insert 1 literal, copy 2 bytes | ||
p 0 0 # literal 0 | ||
p 2 16 # distance 1 + 1 extra bit | ||
b 1 0 # distance 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Request a static dictionary word longer than the metablock size | ||
w 10 last m 6 # window size = 1024 - 16 = 1008 | ||
types 1 # NBLTYPESL | ||
types 1 # NBLTYPESI | ||
types 1 # NBLTYPESD | ||
b 2 0 b 4 0 # NPOSTFIX = 0, NDIRECT = 0 | ||
b 2 0 # context mode for the single literal block type | ||
types 1 # NTREESL | ||
types 1 # NTREESD | ||
s 0 1 8 0 # literal code with one symbol (0), not used | ||
s 1 2 10 128 196 # IaC code with two symbols (128 and 196) | ||
s 2 1 6 35 # one distance code (35 -> 3069 + 0..1023) | ||
p 1 196 # insert 0 literals, copy 22 + 0..7 bytes | ||
b 3 2 # copy length 24 | ||
p 2 35 # distance code 35 (nothing actually emitted) | ||
b 10 803 # at max 3871 -> index 31, transform 120, length 24+3 = 27 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Request more literals than the remaining metablock size | ||
w last m 1 # metablock size 1 | ||
types 1 # NBLTYPESL | ||
types 1 # NBLTYPESI | ||
types 1 # NBLTYPESD | ||
b 2 0 b 4 0 # NPOSTFIX = 0, NDIRECT = 0 | ||
b 2 0 # context mode for the single literal block type | ||
types 1 # NTREESL | ||
types 1 # NTREESD | ||
s 0 1 8 0 # literal code with one symbol (0) | ||
s 1 1 10 144 # IaC code with one symbol (144) | ||
s 2 1 6 35 # one distance code (35) | ||
p 1 144 # insert 2 literals, copy 2 bytes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Request a static dictionary word with a transform > 120 | ||
w 10 last m 6 # window size = 1024 - 16 = 1008 | ||
types 1 # NBLTYPESL | ||
types 1 # NBLTYPESI | ||
types 1 # NBLTYPESD | ||
b 2 0 b 4 0 # NPOSTFIX = 0, NDIRECT = 0 | ||
b 2 0 # context mode for the single literal block type | ||
types 1 # NTREESL | ||
types 1 # NTREESD | ||
s 0 1 8 0 # literal code with one symbol (0), not used | ||
s 1 2 10 128 196 # IaC code with two symbols (128 and 196) | ||
s 2 1 6 35 # one distance code (35 -> 3069 + 0..1023) | ||
p 1 196 # insert 0 literals, copy 22 + 0..7 bytes | ||
b 3 2 # copy length 24 | ||
p 2 35 # distance code 35 (nothing actually emitted) | ||
b 10 804 # gives distance 3873 == (121 << 5) + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# oversubscribed complex code | ||
w last m 6 | ||
types 3 # five symbols | ||
b 2 0 # complex code, skip 0 | ||
len 1 # len 1 (0) | ||
len 1 # len 2 (1) | ||
b 1 1 # 2 bits | ||
b 1 0 # 1 bit | ||
b 1 0 # 1 bit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# premature end of input when decoding a prefix code | ||
w last m 6 | ||
types 1 | ||
types 1 | ||
types 1 | ||
b 2 0 b 4 2 | ||
b 2 0 | ||
b 1 0 b 1 0 | ||
s 0 3 8 "abn" | ||
s 1 1 10 153 | ||
s 2 1 7 17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# reserved bit in metadata block set | ||
w b 4 0xe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# context map run length too long | ||
w last m 6 | ||
types 1 # NBLTYPESL | ||
types 1 # NBLTYPESI | ||
types 1 # NBLTYPESD | ||
b 2 0 b 4 2 # NPOSTFIX = 0, NDIRECT = 2 | ||
b 2 0 # context mode for the single literal block type | ||
types 1 # NTREESL (no context map) | ||
types 2 # NTREESD (not 1 -- followed by context map) | ||
b 5 1 # RLEMAX = 1 | ||
s 0 3 2 0 1 2 # codes for 0, repeat (1), 1 (2) | ||
p 0 1 b 1 1 # 3 zeros (ok so far -- there are four entries) | ||
p 0 1 b 1 1 # 3 zeros (whoops, too many) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Request a static dictionary word with a copy length > 24 | ||
w 10 last m 6 # window size = 1024 - 16 = 1008 | ||
types 1 # NBLTYPESL | ||
types 1 # NBLTYPESI | ||
types 1 # NBLTYPESD | ||
b 2 0 b 4 0 # NPOSTFIX = 0, NDIRECT = 0 | ||
b 2 0 # context mode for the single literal block type | ||
types 1 # NTREESL | ||
types 1 # NTREESD | ||
s 0 1 8 0 # literal code with one symbol (0), not used | ||
s 1 2 10 128 196 # IaC code with two symbols (128 and 196) | ||
s 2 1 6 31 # one distance code (31 -> 765 + 0..255) | ||
p 1 196 # insert 0 literals, copy 22 + 0..7 bytes | ||
b 3 7 # make that 29 bytes, 29 is greater than 24 | ||
p 2 31 # distance code 31 (nothing actually emitted) | ||
b 8 244 # gives distance 1009, past end of 1008 window |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Request a static dictionary word with a copy length < 4 | ||
w 10 last m 6 # window size = 1024 - 16 = 1008 | ||
types 1 # NBLTYPESL | ||
types 1 # NBLTYPESI | ||
types 1 # NBLTYPESD | ||
b 2 0 b 4 0 # NPOSTFIX = 0, NDIRECT = 0 | ||
b 2 0 # context mode for the single literal block type | ||
types 1 # NTREESL | ||
types 1 # NTREESD | ||
s 0 1 8 0 # literal code with one symbol (0), not used | ||
s 1 2 10 128 196 # IaC code with two symbols (128 and 196) | ||
s 2 1 6 31 # one distance code (31 -> 765 + 0..255) | ||
p 1 128 # insert 0 literals, copy 2 bytes (2 is less than 4) | ||
p 2 31 # distance code 31 (nothing actually emitted) | ||
b 8 244 # gives distance 1009, past end of 1008 window |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# too many repeats of last non-zero length (instruction 16) | ||
w last m 6 | ||
types 3 | ||
b 2 3 # complex code, skip 3 | ||
len 0 | ||
len 0 | ||
len 0 | ||
len 1 # instruction 16 (0) | ||
len 0 | ||
len 1 # instruction 17 (1) | ||
b 1 0 b 2 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# too many repeats of zeros (instruction 17) | ||
w last m 6 | ||
types 3 | ||
b 2 3 # complex code, skip 3 | ||
len 0 | ||
len 0 | ||
len 0 | ||
len 1 # instruction 16 (0) | ||
len 0 | ||
len 1 # instruction 17 (1) | ||
b 1 1 b 3 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# stream ends prematurely in uncompressed data | ||
w u |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# bits skipped to get to uncompressed data byte boundary are not all zeros | ||
w u bound 0x7f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# invalid number of window bits (reserved value for later expansion) | ||
b 7 0x11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# excess metadata length bytes (last byte all zeros) | ||
w b 22 0x26 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# excess meta-block nybbles for the length (last nybble all zeros) | ||
w b 23 0x2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
for x in bad/* | ||
do | ||
printf "%s - " $x | ||
./brogen < $x | ./deb -v 2>&1 | grep error | ||
done | ||
echo | ||
for x in good/* | ||
do | ||
echo $x | ||
./brogen < $x | ./deb -v 2>&1 | grep error | ||
done | ||
rm -f deb.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# shortest valid complete stream with a last empty block (one byte, 0x06) | ||
w e -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# a last empty block with length 0 metadata allowed | ||
# (could just have no metadata) | ||
w last e 0 |