Changeset View
Changeset View
Standalone View
Standalone View
autotests/usermetadatawritertest.cpp
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Line(s) | 46 | { | |||
---|---|---|---|---|---|
90 | md.setOriginEmailMessageId(QString()); | 90 | md.setOriginEmailMessageId(QString()); | ||
91 | QVERIFY(!md.hasAttribute(QStringLiteral("xdg.origin.email.message-id"))); | 91 | QVERIFY(!md.hasAttribute(QStringLiteral("xdg.origin.email.message-id"))); | ||
92 | 92 | | |||
93 | // Attribute | 93 | // Attribute | ||
94 | md.setAttribute(QStringLiteral("test.attribute"), QStringLiteral("attribute")); | 94 | md.setAttribute(QStringLiteral("test.attribute"), QStringLiteral("attribute")); | ||
95 | QCOMPARE(md.attribute(QStringLiteral("test.attribute")), QStringLiteral("attribute")); | 95 | QCOMPARE(md.attribute(QStringLiteral("test.attribute")), QStringLiteral("attribute")); | ||
96 | md.setAttribute(QStringLiteral("test.attribute"), QString()); | 96 | md.setAttribute(QStringLiteral("test.attribute"), QString()); | ||
97 | QVERIFY(!md.hasAttribute(QStringLiteral("test.attribute"))); | 97 | QVERIFY(!md.hasAttribute(QStringLiteral("test.attribute"))); | ||
98 | | ||||
99 | // Check for side effects of calling sequence | ||||
100 | QVERIFY(!md.hasAttribute(QStringLiteral("test.check_contains"))); | ||||
101 | md.setAttribute(QStringLiteral("test.check_contains"), QStringLiteral("dummy")); | ||||
102 | QVERIFY(md.hasAttribute(QStringLiteral("test.check_contains"))); | ||||
103 | md.setAttribute(QStringLiteral("test.check_contains"), QString()); | ||||
104 | QVERIFY(!md.hasAttribute(QStringLiteral("test.check_contains"))); | ||||
98 | } | 105 | } | ||
99 | 106 | | |||
100 | void UserMetaDataWriterTest::cleanupTestCase() | 107 | void UserMetaDataWriterTest::cleanupTestCase() | ||
101 | { | 108 | { | ||
102 | QFile::remove(testFilePath(TEST_FILENAME)); | 109 | QFile::remove(testFilePath(TEST_FILENAME)); | ||
103 | } | 110 | } | ||
104 | 111 | | |||
105 | QTEST_GUILESS_MAIN(UserMetaDataWriterTest) | 112 | QTEST_GUILESS_MAIN(UserMetaDataWriterTest) |