ut
ut copied to clipboard
Test class should own its name if constructed with std::string
Expected Behavior
Test passes
Actual Behavior
Test runner crashes due to accessing deallocated string or reports corrupted names:
""runner returned from test w/o signaling: not popping because 'ÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝ' differs from '\0ÍÍÍÍÍÍÍÍÍÍÍ'\n"
or
Running test "▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌"... FAILED
Steps to Reproduce the Problem
Run parametrized test example from readme.
int main() {
for (auto i : std::vector{1, 2, 3}) {
test("parameterized " + std::to_string(i)) = [i] { // 3 tests
expect(that % i > 0); // 3 asserts
};
}
}
Specifications
- Version: master
- Platform: MSVC v143
- Subsystem: runner
Changing
struct test {
std::string_view type{};
- std::string_view name{};
+ std::string name{};
std::vector<std::string_view> tag{};
Fixes this issue