From 115729a86a8eb372263b8c4a59eaab76f2ccef91 Mon Sep 17 00:00:00 2001 From: Roberto Scolaro Date: Thu, 2 Nov 2023 18:42:37 +0100 Subject: [PATCH] fix(unit_test): new macro for env var setting Signed-off-by: Roberto Scolaro --- unit_tests/falco/test_configuration.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/unit_tests/falco/test_configuration.cpp b/unit_tests/falco/test_configuration.cpp index 4c96cba2..47dc8d0f 100644 --- a/unit_tests/falco/test_configuration.cpp +++ b/unit_tests/falco/test_configuration.cpp @@ -18,6 +18,12 @@ limitations under the License. #include #include +#ifdef _WIN32 +#define SET_ENV_VAR(env_var_name, env_var_value) _putenv_s(env_var_name, env_var_value) +#else +#define SET_ENV_VAR(env_var_name, env_var_value) setenv(env_var_name, env_var_value, 1) +#endif + static std::string sample_yaml = "base_value:\n" " id: 1\n"