diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2025-09-09 14:12:48 +0200 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2025-09-09 14:12:48 +0200 |
| commit | 737c87a726b857934672684ffa2ee0b713e44d52 (patch) | |
| tree | 84785a843407845960d8d8158004fc05007766bb /tests | |
| parent | dd9fceaae15e4fa597d0ffbaa12bdaeee26ae637 (diff) | |
Optionally save BMP
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/core/image/test_core_image.odin | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/core/image/test_core_image.odin b/tests/core/image/test_core_image.odin index 29b654f84..82ff2704a 100644 --- a/tests/core/image/test_core_image.odin +++ b/tests/core/image/test_core_image.odin @@ -2389,6 +2389,7 @@ run_jpg_suite :: proc(t: ^testing.T, suite: []Test) { for test in file.tests { img, err := jpeg.load(test_file, test.options) + defer jpeg.destroy(img) passed := (test.expected_error == nil && err == nil) || (test.expected_error == err) testing.expectf(t, passed, "%q failed to load with error %v.", file.file, err) @@ -2402,13 +2403,13 @@ run_jpg_suite :: proc(t: ^testing.T, suite: []Test) { img_hash := hash.crc32(pixels) testing.expectf(t, test.hash == img_hash, "%v test #1's hash is %08x, expected %08x with %v.", file.file, img_hash, test.hash, test.options) - // Save to BMP file to check load - test_bmp := strings.concatenate({TEST_SUITE_PATH_JPG, "/", file.file, ".bmp"}, context.temp_allocator) - - save_err := bmp.save(test_bmp, img) - testing.expectf(t, save_err == nil, "expected saving to BMP in memory not to raise error, got %v", save_err) + // Optionally save to BMP file to check file loaded properly during development + when false { + test_bmp := strings.concatenate({TEST_SUITE_PATH_JPG, "/", file.file, ".bmp"}, context.temp_allocator) + save_err := bmp.save(test_bmp, img) + testing.expectf(t, save_err == nil, "expected saving to BMP not to raise error, got %v", save_err) + } } - bmp.destroy(img) } } return |