From 48a55f5490ff2e5acecbf576d4a7d3acc54b3a26 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sun, 3 Jun 2018 09:26:43 +1000 Subject: [PATCH] Reorganize basic tests to all be in the one file --- test/c/std/gif.c | 14 ++++++++++++++ test/c/std/zlib.c | 20 -------------------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/test/c/std/gif.c b/test/c/std/gif.c index e902b31d..faa2eb38 100644 --- a/test/c/std/gif.c +++ b/test/c/std/gif.c @@ -160,6 +160,19 @@ void test_basic_status_strings() { } } +void test_basic_status_used_package() { + CHECK_FOCUS(__func__); + // The function call here is from "std/gif" but the argument is from + // "std/lzw". The former package depends on the latter. + const char* s0 = + wuffs_gif__status__string(WUFFS_LZW__ERROR_CODE_IS_OUT_OF_RANGE); + const char* t0 = "lzw: code is out of range"; + if (strcmp(s0, t0)) { + FAIL("got \"%s\", want \"%s\"", s0, t0); + return; + } +} + void test_basic_sub_struct_initializer() { CHECK_FOCUS(__func__); wuffs_gif__decoder dec = ((wuffs_gif__decoder){}); @@ -784,6 +797,7 @@ proc tests[] = { test_basic_check_wuffs_version_not_called, // test_basic_status_is_error, // test_basic_status_strings, // + test_basic_status_used_package, // test_basic_sub_struct_initializer, // test_wuffs_gif_call_sequence, // diff --git a/test/c/std/zlib.c b/test/c/std/zlib.c index f487ca72..0d8fa249 100644 --- a/test/c/std/zlib.c +++ b/test/c/std/zlib.c @@ -60,21 +60,6 @@ golden_test zlib_pi_gt = { .src_filename = "../../data/pi.txt.zlib", // }; -// ---------------- Basic Tests - -void test_basic_status_used_package() { - CHECK_FOCUS(__func__); - // The function call here is from "std/zlib" but the argument is from - // "std/deflate". The former package depends on the latter. - const char* s0 = - wuffs_zlib__status__string(WUFFS_DEFLATE__ERROR_BAD_DISTANCE); - const char* t0 = "deflate: bad distance"; - if (strcmp(s0, t0)) { - FAIL("got \"%s\", want \"%s\"", s0, t0); - return; - } -} - // ---------------- Zlib Tests const char* wuffs_zlib_decode(wuffs_base__io_buffer* dst, @@ -244,11 +229,6 @@ void bench_mimic_zlib_decode_100k() { // The empty comments forces clang-format to place one element per line. proc tests[] = { - // These basic tests are really testing the Wuffs compiler. They aren't - // specific to the std/zlib code, but putting them here is as good as any - // other place. - test_basic_status_used_package, // - test_wuffs_zlib_checksum_ignore, // test_wuffs_zlib_checksum_verify_bad, // test_wuffs_zlib_checksum_verify_good, //