We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
runTests()
1 parent 6a14618 commit cfe9b76Copy full SHA for cfe9b76
1 file changed
test/fixture.cpp
@@ -390,9 +390,10 @@ std::size_t TestFixture::runTests(const options& args)
390
// TODO: bail out when given class/test is not found?
391
for (std::string classname : args.which_test()) {
392
std::string testname;
393
- if (classname.find("::") != std::string::npos) {
394
- testname = classname.substr(classname.find("::") + 2);
395
- classname.erase(classname.find("::"));
+ const std::string::size_type pos = classname.find("::");
+ if (pos != std::string::npos) {
+ testname = classname.substr(pos + 2);
396
+ classname.erase(pos);
397
}
398
399
for (TestInstance * test : TestRegistry::theInstance().tests()) {
0 commit comments