Reorganize basic tests to all be in the one file

This commit is contained in:
Nigel Tao committed 2018-06-03 09:26:43 +10:00
1 parent d238ab6d02
commit 48a55f5490
2 files changed
+14 -20

No files matched your search

+14
View File
@@ -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() { void test_basic_sub_struct_initializer() {
CHECK_FOCUS(__func__); CHECK_FOCUS(__func__);
wuffs_gif__decoder dec = ((wuffs_gif__decoder){}); wuffs_gif__decoder dec = ((wuffs_gif__decoder){});
@@ -784,6 +797,7 @@ proc tests[] = {
test_basic_check_wuffs_version_not_called, // test_basic_check_wuffs_version_not_called, //
test_basic_status_is_error, // test_basic_status_is_error, //
test_basic_status_strings, // test_basic_status_strings, //
test_basic_status_used_package, //
test_basic_sub_struct_initializer, // test_basic_sub_struct_initializer, //
test_wuffs_gif_call_sequence, // test_wuffs_gif_call_sequence, //
-20
View File
@@ -60,21 +60,6 @@ golden_test zlib_pi_gt = {
.src_filename = "../../data/pi.txt.zlib", // .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 // ---------------- Zlib Tests
const char* wuffs_zlib_decode(wuffs_base__io_buffer* dst, 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. // The empty comments forces clang-format to place one element per line.
proc tests[] = { 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_ignore, //
test_wuffs_zlib_checksum_verify_bad, // test_wuffs_zlib_checksum_verify_bad, //
test_wuffs_zlib_checksum_verify_good, // test_wuffs_zlib_checksum_verify_good, //