From 2b50678cc57a85e56c55c56c24c8b048c480f00c Mon Sep 17 00:00:00 2001 From: scawful Date: Sun, 28 Sep 2025 19:59:36 -0400 Subject: [PATCH] Refactor test environment setup to use SDL's cross-platform environment variable function - Updated the `SetupTestEnvironment` function in `yaze_test.cc` to replace `setenv` with `SDL_setenv` for setting environment variables, enhancing cross-platform compatibility for test configurations. --- test/yaze_test.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/yaze_test.cc b/test/yaze_test.cc index f4bc8a56..5a5986d6 100644 --- a/test/yaze_test.cc +++ b/test/yaze_test.cc @@ -110,21 +110,21 @@ TestConfig ParseArguments(int argc, char* argv[]) { // Set up test environment based on configuration void SetupTestEnvironment(const TestConfig& config) { - // Set environment variables for tests + // Set environment variables for tests using SDL's cross-platform function if (!config.rom_path.empty()) { - setenv("YAZE_TEST_ROM_PATH", config.rom_path.c_str(), 1); + SDL_setenv("YAZE_TEST_ROM_PATH", config.rom_path.c_str(), 1); } if (config.skip_rom_tests) { - setenv("YAZE_SKIP_ROM_TESTS", "1", 1); + SDL_setenv("YAZE_SKIP_ROM_TESTS", "1", 1); } if (config.enable_ui_tests) { - setenv("YAZE_ENABLE_UI_TESTS", "1", 1); + SDL_setenv("YAZE_ENABLE_UI_TESTS", "1", 1); } if (config.verbose) { - setenv("YAZE_VERBOSE_TESTS", "1", 1); + SDL_setenv("YAZE_VERBOSE_TESTS", "1", 1); } }