Skip to content

Commit

Permalink
update for new thread-safe environment functions in SDL3
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Sep 14, 2024
1 parent c1b2724 commit 94ed961
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ GetTestFilename(TestFileType type, const char *file)
SDL_bool needPathSep = SDL_TRUE;

if (type == TEST_FILE_DIST) {
base = SDL_getenv("SDL_TEST_SRCDIR");
base = SDL_GetEnvironmentVariable(SDL_GetEnvironment(), "SDL_TEST_SRCDIR");
} else {
base = SDL_getenv("SDL_TEST_BUILDDIR");
base = SDL_GetEnvironmentVariable(SDL_GetEnvironment(), "SDL_TEST_BUILDDIR");
}

if (base == NULL) {
Expand Down Expand Up @@ -750,7 +750,7 @@ FormatLoadTest(const Format *format,
"Expected height %d px, got %d",
format->h, surface->h);

if (GetStringBoolean(SDL_getenv("SDL_IMAGE_TEST_DEBUG"), SDL_FALSE)) {
if (GetStringBoolean(SDL_GetEnvironmentVariable(SDL_GetEnvironment(), "SDL_IMAGE_TEST_DEBUG"), SDL_FALSE)) {
DumpPixels(filename, surface);
}

Expand All @@ -761,7 +761,7 @@ FormatLoadTest(const Format *format,
SDLTest_AssertCheck(diff == 0,
"Surface differed from reference by at most %d in %d pixels",
format->tolerance, diff);
if (diff != 0 || GetStringBoolean(SDL_getenv("SDL_IMAGE_TEST_DEBUG"), SDL_FALSE)) {
if (diff != 0 || GetStringBoolean(SDL_GetEnvironmentVariable(SDL_GetEnvironment(), "SDL_IMAGE_TEST_DEBUG"), SDL_FALSE)) {
DumpPixels(filename, surface);
DumpPixels(refFilename, reference);
}
Expand Down Expand Up @@ -890,7 +890,7 @@ FormatSaveTest(const Format *format,
SDLTest_AssertCheck(diff == 0,
"Surface differed from reference by at most %d in %d pixels",
format->tolerance, diff);
if (diff != 0 || GetStringBoolean(SDL_getenv("SDL_IMAGE_TEST_DEBUG"), SDL_FALSE)) {
if (diff != 0 || GetStringBoolean(SDL_GetEnvironmentVariable(SDL_GetEnvironment(), "SDL_IMAGE_TEST_DEBUG"), SDL_FALSE)) {
DumpPixels(filename, surface);
DumpPixels(refFilename, reference);
}
Expand Down Expand Up @@ -920,7 +920,7 @@ FormatTest(const Format *format)
SDL_snprintf(envVar, sizeof(envVar), "SDL_IMAGE_TEST_REQUIRE_LOAD_%s",
format->name);

forced = GetStringBoolean(SDL_getenv(envVar), SDL_FALSE);
forced = GetStringBoolean(SDL_GetEnvironmentVariable(SDL_GetEnvironment(), envVar), SDL_FALSE);
if (forced) {
SDLTest_AssertCheck(format->canLoad,
"%s loading should be enabled", format->name);
Expand Down Expand Up @@ -953,7 +953,7 @@ FormatTest(const Format *format)
SDL_snprintf(envVar, sizeof(envVar), "SDL_IMAGE_TEST_REQUIRE_SAVE_%s",
format->name);

forced = GetStringBoolean(SDL_getenv(envVar), SDL_FALSE);
forced = GetStringBoolean(SDL_GetEnvironmentVariable(SDL_GetEnvironment(), envVar), SDL_FALSE);
if (forced) {
SDLTest_AssertCheck(format->canSave,
"%s saving should be enabled", format->name);
Expand Down

0 comments on commit 94ed961

Please sign in to comment.