首页 > 解决方案 > GoogleTest 无法处理带有 jp 字符的路径

问题描述

在使用 JP 字符的路径上运行我的 Windows 测试应用程序时,它无法调用函数ASSERT_EXIT(myTestFunction(testCase), ::testing::ExitedWithCode(0), "")。当调用myTestFunction(testCase)而不使用 ASSERT_EXIT() 时,调用该函数。

这是函数调用失败的原始代码,

TEST_P(Transponder, startReplaying)
{
    std::string testCase = (std::string)GetParam();
    ASSERT_EXIT(myTestFunction(testCase), ::testing::ExitedWithCode(0), "");
}

我知道 ASSERT_EXIT 是通过子进程调用的。通过 googletest 的子进程调用时如何处理多字节字符串的任何线索?

标签: c++windowsgoogletest

解决方案


推荐阅读