From 25737a39a63e7295650975c1359b9868461018ad Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Tue, 1 Dec 2015 13:11:04 +0100 Subject: QAspectFactory can now also give registered name of an aspect Change-Id: I8f89eefb06e20943f7abb82d461b5e90fd9799f9 Reviewed-by: Paul Lemire --- tests/auto/core/qaspectfactory/tst_qaspectfactory.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') diff --git a/tests/auto/core/qaspectfactory/tst_qaspectfactory.cpp b/tests/auto/core/qaspectfactory/tst_qaspectfactory.cpp index 11e5deaa0..bee09be77 100644 --- a/tests/auto/core/qaspectfactory/tst_qaspectfactory.cpp +++ b/tests/auto/core/qaspectfactory/tst_qaspectfactory.cpp @@ -89,6 +89,20 @@ private Q_SLOTS: QVERIFY(aspect->parent() == Q_NULLPTR); } + void shouldKnowAspectNames() + { + // GIVEN + QAspectFactory factory; + + // WHEN + DefaultFakeAspect fake; + AnotherFakeAspect missing; + + // THEN + QCOMPARE(factory.aspectName(&fake), QString("default")); + QCOMPARE(factory.aspectName(&missing), QString()); + } + void shouldGracefulyHandleMissingFactories() { // GIVEN -- cgit v1.2.3