From 6491dda8ecfcc5e1d3a470c6e6fb9dc92b5fa323 Mon Sep 17 00:00:00 2001
From: Simon McVittie <[EMAIL REDACTED]>
Date: Wed, 25 May 2022 15:09:06 +0100
Subject: [PATCH] test: Enable automated test for TGA format
SDL_image currently has no way to recognise this format from content,
only from filename. Other than that, it's the same as any other format.
Signed-off-by: Simon McVittie <smcv@collabora.com>
---
test/main.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/test/main.c b/test/main.c
index 703f219a..05875ba6 100644
--- a/test/main.c
+++ b/test/main.c
@@ -381,7 +381,6 @@ static const Format formats[] =
IMG_isSVG,
IMG_LoadSVG_RW,
},
-#if 0
{
"TGA",
"sample.tga",
@@ -399,7 +398,6 @@ static const Format formats[] =
NULL,
IMG_LoadTGA_RW,
},
-#endif
{
"TIF",
"sample.tif",
@@ -911,7 +909,13 @@ FormatTest(const Format *format)
FormatLoadTest(format, LOAD_SIZED);
} else {
FormatLoadTest(format, LOAD_CONVENIENCE);
- FormatLoadTest(format, LOAD_RW);
+
+ if (strcmp(format->name, "TGA") == 0) {
+ SDLTest_Log("SKIP: Recognising %s by magic number is not supported", format->name);
+ } else {
+ FormatLoadTest(format, LOAD_RW);
+ }
+
FormatLoadTest(format, LOAD_TYPED_RW);
if (format->loadFunction != NULL) {