[Libreoffice-commits] core.git: sal/cppunittester

Markus Mohrhard markus.mohrhard at googlemail.com
Tue Jan 26 13:22:18 PST 2016


 sal/cppunittester/cppunittester.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 0c018784020653a864d373162287272c82161170
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Jan 26 17:25:41 2016 +0100

    fix the new CPPUNIT_TEST_NAME code
    
    Change-Id: I45260555778a733a8c8ba9e39e9ffcce0c9ab78d
    Reviewed-on: https://gerrit.libreoffice.org/21818
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx
index fb9f85f..22af500 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();
     }
 


More information about the Libreoffice-commits mailing list