From 4d2ecb80c0fee141e529be38a9cc0152d20acce8 Mon Sep 17 00:00:00 2001 From: Jez Higgins Date: Fri, 15 Jan 2010 10:22:02 +0000 Subject: [PATCH] find returns npos when not found, not -1. I blame Java for making me think like that. --- tests/CppUnit/TestRunner.cpp | 2 +- tests/CppUnit/textui/XmlTestResult.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/CppUnit/TestRunner.cpp b/tests/CppUnit/TestRunner.cpp index bb1391eb..b3987164 100644 --- a/tests/CppUnit/TestRunner.cpp +++ b/tests/CppUnit/TestRunner.cpp @@ -85,7 +85,7 @@ bool TestRunner::run(int ac, const char **av) string executable = av[0]; size_t slash = executable.find_last_of("/\\"); - if(slash != -1) + if(slash != string::npos) executable.erase(0, slash+1); executable += "-"; diff --git a/tests/CppUnit/textui/XmlTestResult.cpp b/tests/CppUnit/textui/XmlTestResult.cpp index cfc20d84..1db2ffb3 100644 --- a/tests/CppUnit/textui/XmlTestResult.cpp +++ b/tests/CppUnit/textui/XmlTestResult.cpp @@ -44,7 +44,7 @@ void printException(std::ostream& stream, *w = '?'; std::string what = msg; size_t cut = msg.find_first_of("<>'"); - if(cut != -1) + if(cut != std::string::npos) { msg.erase(cut); msg += "...";