summaryrefslogtreecommitdiff
path: root/tests/auto/generichighlighter
diff options
context:
space:
mode:
authorLeandro Melo <leandro.melo@nokia.com>2010-06-18 16:30:56 +0200
committerLeandro Melo <leandro.melo@nokia.com>2010-06-18 16:31:42 +0200
commit20eeca15ce4014480f39c70db7d848cd99fad7c8 (patch)
treec6d0a72b1140c82aadff070509d941b87fecd601 /tests/auto/generichighlighter
parent81955e045e440dc5932181daccfb1046dd18ba6c (diff)
downloadqt-creator-20eeca15ce4014480f39c70db7d848cd99fad7c8.tar.gz
Generic highlighter: Code folding support.
Diffstat (limited to 'tests/auto/generichighlighter')
-rw-r--r--tests/auto/generichighlighter/highlighterengine/basetextdocumentlayout.h14
-rw-r--r--tests/auto/generichighlighter/highlighterengine/highlightermock.cpp3
2 files changed, 12 insertions, 5 deletions
diff --git a/tests/auto/generichighlighter/highlighterengine/basetextdocumentlayout.h b/tests/auto/generichighlighter/highlighterengine/basetextdocumentlayout.h
index 37320e4361..f3433db632 100644
--- a/tests/auto/generichighlighter/highlighterengine/basetextdocumentlayout.h
+++ b/tests/auto/generichighlighter/highlighterengine/basetextdocumentlayout.h
@@ -32,13 +32,19 @@
/*
Since the text editor plugin directory is not included in the search list of the pro file, this
- file replaces the "real" basetextdocumentlayout.h file. The objective is to simply use
- QTextBlockUserData instead of TextEditor::TextBlockUserData to avoid "external"
- dependencies or intrusive defines.
+ file replaces the "real" basetextdocumentlayout.h file. The objective is to provide a simple
+ TextBlockUserData and avoid "external" dependencies or intrusive defines.
*/
#include <QtGui/QTextBlockUserData>
-typedef QTextBlockUserData TextBlockUserData;
+struct TextBlockUserData : QTextBlockUserData
+{
+ virtual ~TextBlockUserData(){}
+
+ void setFoldingStartIncluded(const bool) {}
+ void setFoldingEndIncluded(const bool) {}
+ void setFoldingIndent(const int) {}
+};
#endif // BASETEXTDOCUMENTLAYOUT_H
diff --git a/tests/auto/generichighlighter/highlighterengine/highlightermock.cpp b/tests/auto/generichighlighter/highlighterengine/highlightermock.cpp
index d558a9eb41..7ed758a5a3 100644
--- a/tests/auto/generichighlighter/highlighterengine/highlightermock.cpp
+++ b/tests/auto/generichighlighter/highlighterengine/highlightermock.cpp
@@ -109,7 +109,8 @@ void HighlighterMock::highlightBlock(const QString &text)
if (m_states.size() <= m_statesCounter)
QFAIL("Expected state for current block not set.");
- QCOMPARE(currentBlockState(), m_states.at(m_statesCounter++));
+ const int observableState = currentBlockState() & 0xFFF;
+ QCOMPARE(observableState, m_states.at(m_statesCounter++));
if (m_formatSequence.size() <= m_formatsCounter)
QFAIL("Expected highlight sequence for current block not set.");