diff options
author | Noel Grandin <noel@peralex.com> | 2016-02-24 10:11:43 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-02-24 11:48:39 +0200 |
commit | a5e53f9ffdde320a7ba104a1e01b3f5ef75d7975 (patch) | |
tree | 49ebc3303916da8298183808630464a4c0ce00d8 /comphelper/qa | |
parent | 2f9d53df89614955215a630beb0966f0c4a663c2 (diff) |
convert TokenTypes to scoped enum
Change-Id: I17c0a616dd6cf48a22896b6cd6b0df157d1f9a9f
Diffstat (limited to 'comphelper/qa')
-rw-r--r-- | comphelper/qa/unit/syntaxhighlighttest.cxx | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/comphelper/qa/unit/syntaxhighlighttest.cxx b/comphelper/qa/unit/syntaxhighlighttest.cxx index 5297bf12ffd7..848c741c3f2f 100644 --- a/comphelper/qa/unit/syntaxhighlighttest.cxx +++ b/comphelper/qa/unit/syntaxhighlighttest.cxx @@ -37,6 +37,11 @@ public: CPPUNIT_TEST_SUITE_END(); }; +std::ostream& operator<<(std::ostream& rStrm, const TokenType& tt) +{ + return rStrm << (int)tt; +} + void SyntaxHighlightTest::testBasicString() { OUString s("\"foo\""); std::vector<HighlightPortion> ps; @@ -45,7 +50,7 @@ void SyntaxHighlightTest::testBasicString() { static_cast<std::vector<HighlightPortion>::size_type>(1), ps.size()); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), ps[0].nBegin); CPPUNIT_ASSERT_EQUAL(sal_Int32(5), ps[0].nEnd); - CPPUNIT_ASSERT_EQUAL(TT_STRING, ps[0].tokenType); + CPPUNIT_ASSERT_EQUAL(TokenType::String, ps[0].tokenType); } void SyntaxHighlightTest::testBasicComment() { @@ -56,7 +61,7 @@ void SyntaxHighlightTest::testBasicComment() { static_cast<std::vector<HighlightPortion>::size_type>(1), ps.size()); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), ps[0].nBegin); CPPUNIT_ASSERT_EQUAL(sal_Int32(5), ps[0].nEnd); - CPPUNIT_ASSERT_EQUAL(TT_COMMENT, ps[0].tokenType); + CPPUNIT_ASSERT_EQUAL(TokenType::Comment, ps[0].tokenType); } void SyntaxHighlightTest::testBasicCommentNewline() { @@ -67,10 +72,10 @@ void SyntaxHighlightTest::testBasicCommentNewline() { static_cast<std::vector<HighlightPortion>::size_type>(2), ps.size()); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), ps[0].nBegin); CPPUNIT_ASSERT_EQUAL(sal_Int32(5), ps[0].nEnd); - CPPUNIT_ASSERT_EQUAL(TT_COMMENT, ps[0].tokenType); + CPPUNIT_ASSERT_EQUAL(TokenType::Comment, ps[0].tokenType); CPPUNIT_ASSERT_EQUAL(sal_Int32(5), ps[1].nBegin); CPPUNIT_ASSERT_EQUAL(sal_Int32(6), ps[1].nEnd); - CPPUNIT_ASSERT_EQUAL(TT_EOL, ps[1].tokenType); + CPPUNIT_ASSERT_EQUAL(TokenType::EOL, ps[1].tokenType); } void SyntaxHighlightTest::testBasicEmptyComment() { @@ -81,7 +86,7 @@ void SyntaxHighlightTest::testBasicEmptyComment() { static_cast<std::vector<HighlightPortion>::size_type>(1), ps.size()); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), ps[0].nBegin); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), ps[0].nEnd); - CPPUNIT_ASSERT_EQUAL(TT_COMMENT, ps[0].tokenType); + CPPUNIT_ASSERT_EQUAL(TokenType::Comment, ps[0].tokenType); } void SyntaxHighlightTest::testBasicEmptyCommentNewline() { @@ -92,10 +97,10 @@ void SyntaxHighlightTest::testBasicEmptyCommentNewline() { static_cast<std::vector<HighlightPortion>::size_type>(2), ps.size()); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), ps[0].nBegin); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), ps[0].nEnd); - CPPUNIT_ASSERT_EQUAL(TT_COMMENT, ps[0].tokenType); + CPPUNIT_ASSERT_EQUAL(TokenType::Comment, ps[0].tokenType); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), ps[1].nBegin); CPPUNIT_ASSERT_EQUAL(sal_Int32(2), ps[1].nEnd); - CPPUNIT_ASSERT_EQUAL(TT_EOL, ps[1].tokenType); + CPPUNIT_ASSERT_EQUAL(TokenType::EOL, ps[1].tokenType); } void SyntaxHighlightTest::testBasic() |