From 10991bf26e1cf938e5df1c3c1cec5adf44b3b5eb Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 13 Mar 2017 12:58:35 +0100 Subject: 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 --- ApiExtractor/tests/testremoveoperatormethod.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ApiExtractor/tests/testremoveoperatormethod.cpp') 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() \n\ \n\ \n"; - TestUtil t(cppCode, xmlCode, false); - AbstractMetaClassList classes = t.builder()->classes(); + QScopedPointer 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); -- cgit v1.2.3