1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-03 12:09:39 +00:00

added quotes and introduced test to cover space in directory for config files

This commit is contained in:
Bret Curtis 2023-05-02 09:33:54 +02:00
parent df06e0d7b9
commit 61fb575757

View file

@ -42,11 +42,11 @@ int runBinary(
{ {
#ifdef _WIN32 #ifdef _WIN32
std::wstringstream cmd; 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()); return _wsystem(cmd.str().c_str());
#else #else
std::stringstream cmd; std::stringstream cmd;
cmd << binaryPath << " -i " << iniPath << " -c " << cfgPath; cmd << binaryPath << " -i " << "'" << iniPath << "'" << " -c " << "'" << cfgPath << "'";
return std::system(cmd.str().c_str()); return std::system(cmd.str().c_str());
#endif #endif
} }
@ -57,7 +57,7 @@ struct TestParam
std::string fileName; std::string fileName;
}; };
const std::vector<TestParam> testParams = { { "ascii", "ascii" }, { "unicode", "(╯°□°)╯︵ ┻━┻" }, { "emoji", "💩" } }; const std::vector<TestParam> testParams = { { "ascii", "ascii" }, { "space", "spaaaaa ce" }, { "unicode", "(╯°□°)╯︵ ┻━┻" }, { "emoji", "💩" } };
class IniImporterTest : public ::testing::TestWithParam<TestParam> class IniImporterTest : public ::testing::TestWithParam<TestParam>
{ {