diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-01-26 17:25:41 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-01-26 21:21:44 +0000 |
commit | 0c018784020653a864d373162287272c82161170 (patch) | |
tree | 99ff4728f41fc39f8b362643cc12d19d7bc3977f /sal/cppunittester | |
parent | b1ba84efc38821d5d272448cb34af7519306b8ce (diff) |
fix the new CPPUNIT_TEST_NAME code
Change-Id: I45260555778a733a8c8ba9e39e9ffcce0c9ab78d
Reviewed-on: https://gerrit.libreoffice.org/21818
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sal/cppunittester')
-rw-r--r-- | sal/cppunittester/cppunittester.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx index fb9f85f06e00..22af5001fda7 100644 --- a/sal/cppunittester/cppunittester.cxx +++ b/sal/cppunittester/cppunittester.cxx @@ -180,7 +180,11 @@ struct test_name_compare bool operator()(const std::string& rCmp) { - size_t nEndPos = maName.find(rCmp) + rCmp.size(); + size_t nPos = maName.find(rCmp); + if (nPos == std::string::npos) + return false; + + size_t nEndPos = nPos + rCmp.size(); return nEndPos == maName.size(); } |