From 61fb575757dd1f756cfafbc91433b53c28936f34 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Tue, 2 May 2023 09:33:54 +0200 Subject: [PATCH] added quotes and introduced test to cover space in directory for config files --- apps/mwiniimporter_tests/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/mwiniimporter_tests/main.cpp b/apps/mwiniimporter_tests/main.cpp index 66e54d6675..db4917a176 100644 --- a/apps/mwiniimporter_tests/main.cpp +++ b/apps/mwiniimporter_tests/main.cpp @@ -42,11 +42,11 @@ int runBinary( { #ifdef _WIN32 std::wstringstream cmd; - cmd << binaryPath.native() << L" -i " << iniPath.native() << L" -c " << cfgPath.native(); + cmd << binaryPath.native() << L" -i " << '"' << iniPath.native() << '"' << L" -c " << '"' << cfgPath.native() << '"'; return _wsystem(cmd.str().c_str()); #else std::stringstream cmd; - cmd << binaryPath << " -i " << iniPath << " -c " << cfgPath; + cmd << binaryPath << " -i " << "'" << iniPath << "'" << " -c " << "'" << cfgPath << "'"; return std::system(cmd.str().c_str()); #endif } @@ -57,7 +57,7 @@ struct TestParam std::string fileName; }; -const std::vector testParams = { { "ascii", "ascii" }, { "unicode", "(╯°□°)╯︵ ┻━┻" }, { "emoji", "💩" } }; +const std::vector testParams = { { "ascii", "ascii" }, { "space", "spaaaaa ce" }, { "unicode", "(╯°□°)╯︵ ┻━┻" }, { "emoji", "💩" } }; class IniImporterTest : public ::testing::TestWithParam {