mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 00:32:11 +01:00
Rename test/testdata to test/data
This commit is contained in:
1 parent
bbc3d34e1b
commit
d1399fac19
107 files changed
+110
-114
No files matched your search
@@ -21,9 +21,9 @@ Wrangling those formats that build on deflate (gzip, zip and zlib) is not
|
||||
provided by this package. For zlib, look at the `std/zlib` package instead. The
|
||||
other formats are TODO.
|
||||
|
||||
For example, look at `test/testdata/romeo.txt*`. First, the uncompressed text:
|
||||
For example, look at `test/data/romeo.txt*`. First, the uncompressed text:
|
||||
|
||||
$ xxd test/testdata/romeo.txt
|
||||
$ xxd test/data/romeo.txt
|
||||
00000000: 526f 6d65 6f20 616e 6420 4a75 6c69 6574 Romeo and Juliet
|
||||
00000010: 0a45 7863 6572 7074 2066 726f 6d20 4163 .Excerpt from Ac
|
||||
etc
|
||||
@@ -32,7 +32,7 @@ For example, look at `test/testdata/romeo.txt*`. First, the uncompressed text:
|
||||
|
||||
The raw deflate encoding:
|
||||
|
||||
$ xxd test/testdata/romeo.txt.deflate
|
||||
$ xxd test/data/romeo.txt.deflate
|
||||
00000000: 4d53 c16e db30 0cbd f32b d853 2e46 0e3d MS.n.0...+.S.F.=
|
||||
00000010: 2e87 20ed 0234 c5ba 0049 861e 861d 149b .. ..4...I......
|
||||
etc
|
||||
@@ -45,7 +45,7 @@ C string name of the original, uncompressed file, "romeo.txt", amongst other
|
||||
data. The footer contains a 4 byte CRC32 checksum and a 4 byte length of the
|
||||
uncompressed file (0x3ae = 942 bytes).
|
||||
|
||||
$ xxd test/testdata/romeo.txt.gz
|
||||
$ xxd test/data/romeo.txt.gz
|
||||
00000000: 1f8b 0808 26d8 5d59 0003 726f 6d65 6f2e ....&.]Y..romeo.
|
||||
00000010: 7478 7400 4d53 c16e db30 0cbd f32b d853 txt.MS.n.0...+.S
|
||||
etc
|
||||
@@ -56,7 +56,7 @@ The zlib format wraps a 2 byte header and 4 byte footer around the raw deflate
|
||||
data. The footer contains a 4 byte Adler32 checksum. TODO: move this to
|
||||
std/zlib/README.md.
|
||||
|
||||
$ xxd test/testdata/romeo.txt.zlib
|
||||
$ xxd test/data/romeo.txt.zlib
|
||||
00000000: 789c 4d53 c16e db30 0cbd f32b d853 2e46 x.MS.n.0...+.S.F
|
||||
00000010: 0e3d 2e87 20ed 0234 c5ba 0049 861e 861d .=.. ..4...I....
|
||||
etc
|
||||
@@ -66,7 +66,7 @@ std/zlib/README.md.
|
||||
|
||||
# Wire Format Worked Example
|
||||
|
||||
Consider `test/testdata/romeo.txt.deflate`. The relevant spec is RFC 1951.
|
||||
Consider `test/data/romeo.txt.deflate`. The relevant spec is RFC 1951.
|
||||
|
||||
offset xoffset ASCII hex binary
|
||||
000000 0x0000 M 0x4D 0b_0100_1101
|
||||
|
||||
+10
-10
@@ -7,7 +7,7 @@ specification](https://www.w3.org/Graphics/GIF/spec-gif89a.txt).
|
||||
|
||||
# Wire Format Worked Example
|
||||
|
||||
Consider `test/testdata/bricks-nodither.gif`.
|
||||
Consider `test/data/bricks-nodither.gif`.
|
||||
|
||||
offset xoffset ASCII hex binary
|
||||
000000 0x0000 G 0x47 0b_0100_0111
|
||||
@@ -206,10 +206,10 @@ Significant Bits) and MSB (Most Significant Bits) first. The GIF format uses
|
||||
LSB first. The PDF and TIFF formats use MSB first, but are not discussed here.
|
||||
|
||||
It is not an official format, but the
|
||||
`test/testdata/bricks-nodither.indexes.giflzw` file contains the extracted
|
||||
"Pixel Data" payload from `test/testdata/bricks-nodither.gif`, preceded by the
|
||||
one byte `log2(literal_width)`. Deriving a separate file, as a separate,
|
||||
contiguous stream, makes it easier to discuss the LZW compression format.
|
||||
`test/data/bricks-nodither.indexes.giflzw` file contains the extracted "Pixel
|
||||
Data" payload from `test/data/bricks-nodither.gif`, preceded by the one byte
|
||||
`log2(literal_width)`. Deriving a separate file, as a separate, contiguous
|
||||
stream, makes it easier to discuss the LZW compression format.
|
||||
|
||||
offset xoffset ASCII hex binary
|
||||
000000 0x0000 . 0x08 0b_0000_1000
|
||||
@@ -284,8 +284,8 @@ depending on `max`. For example, if `max` is in the range [256, 511] then the
|
||||
next code takes 9 bits, if `max` is in the range [512, 1023] then `width ==
|
||||
10`, and so on. For GIF, when a code spans multiple bytes, codes are formed
|
||||
Least Significant Bits first. For the
|
||||
`test/testdata/bricks-nodither.indexes.giflzw` example, `l2lw == 8` and so
|
||||
`width` starts at 9 bits. Printing the bits on byte boundaries give:
|
||||
`test/data/bricks-nodither.indexes.giflzw` example, `l2lw == 8` and so `width`
|
||||
starts at 9 bits. Printing the bits on byte boundaries give:
|
||||
|
||||
offset xoffset ASCII hex binary
|
||||
000001 0x0001 . 0x00 0b_0000_0000
|
||||
@@ -452,8 +452,8 @@ bytes and then an 0xD9.
|
||||
## Actual Pixel Indexes
|
||||
|
||||
It is also not an official format, but for reference, the
|
||||
`test/testdata/bricks-nodither.indexes` contains the decoded
|
||||
`test/testdata/bricks-nodither.indexes.giflzw` data:
|
||||
`test/data/bricks-nodither.indexes` contains the decoded
|
||||
`test/data/bricks-nodither.indexes.giflzw` data:
|
||||
|
||||
offset xoffset ASCII hex binary
|
||||
000000 0x0000 . 0xDC 0b_1101_1100
|
||||
@@ -486,6 +486,6 @@ We have 19200 = 160 × 120 pixels. The top row starts with five pixels with RGB
|
||||
values indexed by 0xDC (or 220 in decimal, and recall that the GCT maps color
|
||||
220 to {0x0F, 0xA7, 0xF6}), the bottom row ends with index 0x4F.
|
||||
|
||||
Indeed, opening `test/testdata/bricks-nodither.gif` in an image editor should
|
||||
Indeed, opening `test/data/bricks-nodither.gif` in an image editor should
|
||||
verify that the top left pixel's RGB is {0x0F, 0xA7, 0xF6}, and likewise the
|
||||
bottom right pixel's RGB is {0x01, 0x24, 0x63}.
|
||||
Reference in new issue
Block a user