void tst_QPlaceCategory::isEmptyTest() { QPlaceIcon icon; QVariantMap parameters; parameters.insert(QLatin1String("para"), QLatin1String("meter")); icon.setParameters(parameters); QVERIFY(!icon.isEmpty()); QPlaceCategory category; QVERIFY(category.isEmpty()); category.setName(QStringLiteral("name")); QVERIFY(!category.isEmpty()); category.setName(QString()); QVERIFY(category.isEmpty()); category.setCategoryId(QStringLiteral("id")); QVERIFY(!category.isEmpty()); category.setCategoryId(QString()); QVERIFY(category.isEmpty()); category.setVisibility(QLocation::PublicVisibility); QVERIFY(!category.isEmpty()); category.setVisibility(QLocation::UnspecifiedVisibility); QVERIFY(category.isEmpty()); category.setIcon(icon); QVERIFY(!category.isEmpty()); category.setIcon(QPlaceIcon()); QVERIFY(category.isEmpty()); }
void tst_QPlaceCategory::categoryIdTest() { QPlaceCategory testObj; QVERIFY2(testObj.categoryId() == QString(), "Wrong default value"); testObj.setCategoryId("testText"); QVERIFY2(testObj.categoryId() == "testText", "Wrong value returned"); }
void tst_QPlaceCategory::constructorTest() { QPlaceCategory testObj; Q_UNUSED(testObj); testObj.setCategoryId("testId"); QPlaceCategory *testObjPtr = new QPlaceCategory(testObj); QVERIFY2(testObjPtr != NULL, "Copy constructor - null"); QVERIFY2(*testObjPtr == testObj, "Copy constructor - compare"); delete testObjPtr; }