From c7f3ac407394d3c4d7fe817a6a913cd3256c37e5 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 19 Dec 2013 01:30:49 +0100 Subject: CppEditor/CppTools: Clean up *Test* classes * Unify class names * Fix coding style Change-Id: I7498192ba9e6b9fc0e97d3d4f0dbb30f1853a0c9 Reviewed-by: Erik Verbruggen --- src/plugins/cppeditor/cppdoxygen_test.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/plugins/cppeditor/cppdoxygen_test.cpp') diff --git a/src/plugins/cppeditor/cppdoxygen_test.cpp b/src/plugins/cppeditor/cppdoxygen_test.cpp index 41d940e4cb..87b78c6a79 100644 --- a/src/plugins/cppeditor/cppdoxygen_test.cpp +++ b/src/plugins/cppeditor/cppdoxygen_test.cpp @@ -59,18 +59,18 @@ typedef QByteArray _; * Encapsulates the whole process of setting up an editor, * pressing ENTER and checking the result. */ -class TestCase : public CppEditor::Internal::Tests::TestCase +class DoxygenTestCase : public CppEditor::Internal::Tests::TestCase { public: - TestCase(const QByteArray &input); - void run(const QByteArray &expected, int undoCount = 1); + DoxygenTestCase(const QByteArray &input); + void run(const QByteArray &expected); private: CppEditor::Internal::Tests::TestDocument testDocument; }; /// The '|' in the input denotes the cursor position. -TestCase::TestCase(const QByteArray &input) +DoxygenTestCase::DoxygenTestCase(const QByteArray &input) : testDocument("file.cpp", input, '|') { QVERIFY(testDocument.hasCursorMarker()); @@ -97,7 +97,7 @@ TestCase::TestCase(const QByteArray &input) waitForRehighlightedSemanticDocument(testDocument.m_editorWidget); } -void TestCase::run(const QByteArray &expected, int undoCount) +void DoxygenTestCase::run(const QByteArray &expected) { // Send 'ENTER' key press QKeyEvent event(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier); @@ -106,12 +106,12 @@ void TestCase::run(const QByteArray &expected, int undoCount) QCOMPARE(QLatin1String(result), QLatin1String(expected)); - for (int i = 0; i < undoCount; ++i) - testDocument.m_editorWidget->undo(); + testDocument.m_editorWidget->undo(); const QByteArray contentsAfterUndo = testDocument.m_editorWidget->document()->toPlainText().toUtf8(); QCOMPARE(contentsAfterUndo, testDocument.m_source); } + } // anonymous namespace void CppEditorPlugin::test_doxygen_comments_data() @@ -257,6 +257,6 @@ void CppEditorPlugin::test_doxygen_comments() { QFETCH(QByteArray, given); QFETCH(QByteArray, expected); - TestCase data(given); - data.run(expected); + DoxygenTestCase test(given); + test.run(expected); } -- cgit v1.2.1