[Libreoffice-commits] core.git: comphelper/Module_comphelper.mk comphelper/qa

Stephan Bergmann sbergman at redhat.com
Wed Oct 23 00:32:57 PDT 2013


 comphelper/Module_comphelper.mk            |    1 +
 comphelper/qa/unit/syntaxhighlighttest.cxx |    8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 51ac50b538534f47af78379628460d29eb6589cf
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Oct 23 09:32:17 2013 +0200

    Fix and enable CppunitTest_comphelper_syntaxhighlight_test
    
    Change-Id: I2b2aa5f5afdbf58ec3ac2447db370bcb7d1778c0

diff --git a/comphelper/Module_comphelper.mk b/comphelper/Module_comphelper.mk
index 48bf740..75d7c2a 100644
--- a/comphelper/Module_comphelper.mk
+++ b/comphelper/Module_comphelper.mk
@@ -28,6 +28,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,comphelper,\
 ))
 
 $(eval $(call gb_Module_add_check_targets,comphelper,\
+    CppunitTest_comphelper_syntaxhighlight_test \
     CppunitTest_comphelper_test \
 ))
 
diff --git a/comphelper/qa/unit/syntaxhighlighttest.cxx b/comphelper/qa/unit/syntaxhighlighttest.cxx
index 244a1a0..830e233 100644
--- a/comphelper/qa/unit/syntaxhighlighttest.cxx
+++ b/comphelper/qa/unit/syntaxhighlighttest.cxx
@@ -36,14 +36,14 @@ void SyntaxHighlightTest::testBasicString()
     std::vector<HighlightPortion> aPortions;
     aHighlighter.getHighlightPortions( 0, aBasicString, aPortions );
 
-
-    // check that all strings are valid
+    sal_Int32 prevEnd = 0;
     for(std::vector<HighlightPortion>::const_iterator itr =
             aPortions.begin(), itrEnd = aPortions.end(); itr != itrEnd; ++itr)
     {
-        CPPUNIT_ASSERT(itr->nBegin < aBasicString.getLength());
-        //CPPUNIT_ASSERT(itr->nEnd < aBasicString.getLength());
+        CPPUNIT_ASSERT_EQUAL(prevEnd, itr->nBegin);
+        prevEnd = itr->nEnd;
     }
+    CPPUNIT_ASSERT_EQUAL(aBasicString.getLength(), prevEnd);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(SyntaxHighlightTest);


More information about the Libreoffice-commits mailing list