Skip to content

Commit

Permalink
Merge branch 'bmp' of github.com:Kelimion/Odin into bmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelimion committed Jun 6, 2024
2 parents 2566b9b + eb3df4e commit 8b76156
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/core/image/build.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@echo off
odin test . -define:ODIN_TEST_PROGRESS_WIDTH=12 -vet -strict-style
odin test . -vet -strict-style
10 changes: 6 additions & 4 deletions tests/core/image/test_core_image.odin
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ import "core:strings"
import "core:mem"
import "core:time"

TEST_SUITE_PATH_PNG :: ODIN_ROOT + "tests/core/assets/PNG"
TEST_SUITE_PATH_BMP :: ODIN_ROOT + "tests/core/assets/BMP"

I_Error :: image.Error
TEST_SUITE_PATH :: ODIN_ROOT + "tests/core/assets/"

Test :: struct {
file: string,
Expand Down Expand Up @@ -1452,7 +1454,7 @@ png_test_no_postproc :: proc(t: ^testing.T) {

run_png_suite :: proc(t: ^testing.T, suite: []Test) {
for file in suite {
test_file := strings.concatenate({TEST_SUITE_PATH, "/PNG/", file.file, ".png"}, context.allocator)
test_file := strings.concatenate({TEST_SUITE_PATH_PNG, "/", file.file, ".png"}, context.allocator)
defer delete(test_file)

img: ^png.Image
Expand Down Expand Up @@ -2315,7 +2317,7 @@ bmp_test_known_bad :: proc(t: ^testing.T) {

run_bmp_suite :: proc(t: ^testing.T, suite: []Test) {
for file in suite {
test_file := strings.concatenate({TEST_SUITE_PATH, "/BMP/", file.file, ".bmp"}, context.allocator)
test_file := strings.concatenate({TEST_SUITE_PATH_BMP, "/", file.file, ".bmp"}, context.allocator)
defer delete(test_file)

for test in file.tests {
Expand All @@ -2325,7 +2327,7 @@ run_bmp_suite :: proc(t: ^testing.T, suite: []Test) {
testing.expectf(t, passed, "%q failed to load with error %v.", file.file, err)

if err == nil { // No point in running the other tests if it didn't load.
qoi_file := strings.concatenate({TEST_SUITE_PATH, "/BMP/", file.file, ".qoi"}, context.allocator)
qoi_file := strings.concatenate({TEST_SUITE_PATH_BMP, "/", file.file, ".qoi"}, context.allocator)
defer delete(qoi_file)

qoi.save(qoi_file, img)
Expand Down

0 comments on commit 8b76156

Please sign in to comment.