diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-03-13 12:58:35 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-03-13 13:39:19 +0000 |
commit | 10991bf26e1cf938e5df1c3c1cec5adf44b3b5eb (patch) | |
tree | d3280095acece0f43aad94193507bda6008af9e2 /ApiExtractor/tests/testremoveoperatormethod.cpp | |
parent | 9bad5b23dd1ed7274273fd8ad882c3f6acc6ccd8 (diff) |
Refactor TestUtil of ApiExtractor
Change the class TestUtil to a namespace containing a free function
returning the AbstractMetaBuilder instance on success. Use QScopedPointer
in the tests and add checks.
This makes it possible to detect parse errors which would previously only
trigger an assert.
Change-Id: Iea3a8fb62515602c76b10eab4889400af5b26b34
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'ApiExtractor/tests/testremoveoperatormethod.cpp')
-rw-r--r-- | ApiExtractor/tests/testremoveoperatormethod.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ApiExtractor/tests/testremoveoperatormethod.cpp b/ApiExtractor/tests/testremoveoperatormethod.cpp index e579dc8b3..6fcc80278 100644 --- a/ApiExtractor/tests/testremoveoperatormethod.cpp +++ b/ApiExtractor/tests/testremoveoperatormethod.cpp @@ -85,8 +85,9 @@ void TestRemoveOperatorMethod::testRemoveOperatorMethod() <modify-function signature='operator>>(String&)' remove='all'/>\n\ </object-type>\n\ </typesystem>\n"; - TestUtil t(cppCode, xmlCode, false); - AbstractMetaClassList classes = t.builder()->classes(); + QScopedPointer<AbstractMetaBuilder> builder(TestUtil::parse(cppCode, xmlCode, false)); + QVERIFY(!builder.isNull()); + AbstractMetaClassList classes = builder->classes(); AbstractMetaClass* classA = classes.findClass(QLatin1String("A")); QVERIFY(classA); QCOMPARE(classA->functions().size(), 14); |