From 27a33ff27ceab10ee915a50d7625c28b91e8e7bf Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sun, 22 Oct 2017 11:41:06 +1100 Subject: [PATCH] Add a test/testdata/artificial directory. --- test/c/std/flate.c | 8 ++++---- test/testdata/README.md | 11 ++++++++++- test/testdata/{ => artificial}/256.bytes | Bin test/testdata/{ => artificial}/256.bytes.gz | Bin 4 files changed, 14 insertions(+), 5 deletions(-) rename test/testdata/{ => artificial}/256.bytes (100%) rename test/testdata/{ => artificial}/256.bytes.gz (100%) diff --git a/test/c/std/flate.c b/test/c/std/flate.c index 8e4f2aa1..4ed15985 100644 --- a/test/c/std/flate.c +++ b/test/c/std/flate.c @@ -59,10 +59,10 @@ golden_test checksum_pi_gt = { }; golden_test flate_256_bytes_gt = { - .want_filename = "../../testdata/256.bytes", // - .src_filename = "../../testdata/256.bytes.gz", // - .src_offset0 = 20, // - .src_offset1 = 281, // + .want_filename = "../../testdata/artificial/256.bytes", // + .src_filename = "../../testdata/artificial/256.bytes.gz", // + .src_offset0 = 20, // + .src_offset1 = 281, // }; golden_test flate_midsummer_gt = { diff --git a/test/testdata/README.md b/test/testdata/README.md index 75c93b80..7793b021 100644 --- a/test/testdata/README.md +++ b/test/testdata/README.md @@ -11,7 +11,16 @@ command line tool. -256.bytes just holds "\x00\x01\x02\x03...\xff". +The artificial directory holds artificially generated test data, often to +explicitly test corner cases of various file formats. The files there usually +come in families whose names have a common prefix, such as three files +"foo.bar", "foo.bar.qux", "foo.bar.commentary.txt" all prefixed by "foo.bar". +The file whose name is that prefix is usually the canonical (typically +hand-crafted) file, and the other files are then derived from that. Outside of +the artificial directory, the other files in this directory are typically real +world examples of various file formats, or deriviations of them. + + bricks-* are various encodings of an original photo by Nigel Tao . diff --git a/test/testdata/256.bytes b/test/testdata/artificial/256.bytes similarity index 100% rename from test/testdata/256.bytes rename to test/testdata/artificial/256.bytes diff --git a/test/testdata/256.bytes.gz b/test/testdata/artificial/256.bytes.gz similarity index 100% rename from test/testdata/256.bytes.gz rename to test/testdata/artificial/256.bytes.gz