From 590fa9441c01ec1acf987091929a4d07d744b72b Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Fri, 4 Oct 2013 21:53:07 +0800 Subject: Rename QDeclarativeNdefRecord -> QQmlNdefRecord The QDeclarative* class prefix is associated with the now-deprecated Qt Declarative module (a.k.a. Qt Quick 1). In Qt Quick 2, all QDeclarative* classes have been renamed to QQml* or QQuick* Also rename the example, QDeclarativeNdefFooRecord -> QQmlNdefFooRecord Change-Id: Ie81a9ea2fdda145ad749afb07ef758f791b278d0 Reviewed-by: Alex Blasche --- tests/auto/qndefrecord/tst_qndefrecord.cpp | 48 +++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'tests') diff --git a/tests/auto/qndefrecord/tst_qndefrecord.cpp b/tests/auto/qndefrecord/tst_qndefrecord.cpp index 6ccb9566..000ff017 100644 --- a/tests/auto/qndefrecord/tst_qndefrecord.cpp +++ b/tests/auto/qndefrecord/tst_qndefrecord.cpp @@ -44,7 +44,7 @@ #include #include #include -#include +#include QT_USE_NAMESPACE @@ -99,10 +99,10 @@ void tst_QNdefRecord::tst_record() QCOMPARE(record, QNdefRecord()); QVERIFY(!(record != QNdefRecord())); - QDeclarativeNdefRecord declRecord; + QQmlNdefRecord declRecord; QCOMPARE(declRecord.record(), record); QCOMPARE(declRecord.type(), QString()); - QCOMPARE(declRecord.typeNameFormat(), QDeclarativeNdefRecord::Empty); + QCOMPARE(declRecord.typeNameFormat(), QQmlNdefRecord::Empty); } // test type name format @@ -256,10 +256,10 @@ void tst_QNdefRecord::tst_textRecord() QVERIFY(record != QNdefRecord()); - QDeclarativeNdefRecord declRecord(record); + QQmlNdefRecord declRecord(record); QCOMPARE(declRecord.record(), QNdefRecord(record)); QCOMPARE(declRecord.type(), QString("T")); - QCOMPARE(declRecord.typeNameFormat(), QDeclarativeNdefRecord::NfcRtd); + QCOMPARE(declRecord.typeNameFormat(), QQmlNdefRecord::NfcRtd); } // test getters @@ -325,10 +325,10 @@ void tst_QNdefRecord::tst_uriRecord() QVERIFY(record != QNdefRecord()); - QDeclarativeNdefRecord declRecord(record); + QQmlNdefRecord declRecord(record); QCOMPARE(declRecord.record(), QNdefRecord(record)); QCOMPARE(declRecord.type(), QString("U")); - QCOMPARE(declRecord.typeNameFormat(), QDeclarativeNdefRecord::NfcRtd); + QCOMPARE(declRecord.typeNameFormat(), QQmlNdefRecord::NfcRtd); } // test getters @@ -386,34 +386,34 @@ void tst_QNdefRecord::tst_declarative_record() QCOMPARE(record.typeNameFormat(), typeNameFormat); QCOMPARE(record.type(), type); - QDeclarativeNdefRecord declRecord(record); + QQmlNdefRecord declRecord(record); QCOMPARE(declRecord.record(), record); QCOMPARE(declRecord.record().typeNameFormat(), typeNameFormat); QCOMPARE(declRecord.record().type(), type); QCOMPARE(declRecord.type(), QString(type)); - QCOMPARE(declRecord.typeNameFormat(), static_cast(typeNameFormat)); + QCOMPARE(declRecord.typeNameFormat(), static_cast(typeNameFormat)); - QDeclarativeNdefRecord declRecord2; + QQmlNdefRecord declRecord2; declRecord2.setRecord(record); QCOMPARE(declRecord2.record(), record); QCOMPARE(declRecord2.record().typeNameFormat(), typeNameFormat); QCOMPARE(declRecord2.record().type(), type); QCOMPARE(declRecord2.type(), QString(type)); - QCOMPARE(declRecord2.typeNameFormat(), static_cast(typeNameFormat)); + QCOMPARE(declRecord2.typeNameFormat(), static_cast(typeNameFormat)); - QDeclarativeNdefRecord declRecord3; - declRecord3.setTypeNameFormat((QDeclarativeNdefRecord::TypeNameFormat)typeNameFormat); + QQmlNdefRecord declRecord3; + declRecord3.setTypeNameFormat((QQmlNdefRecord::TypeNameFormat)typeNameFormat); declRecord3.setType(type); QCOMPARE(declRecord3.type(), QString(type)); QCOMPARE(declRecord3.record().typeNameFormat(), typeNameFormat); QCOMPARE(declRecord3.record().type(), type); - QCOMPARE(declRecord3.typeNameFormat(), static_cast(typeNameFormat)); + QCOMPARE(declRecord3.typeNameFormat(), static_cast(typeNameFormat)); } } void tst_QNdefRecord::tst_declarativeChangedSignals() { - QDeclarativeNdefRecord record; + QQmlNdefRecord record; QSignalSpy typeSpy(&record, SIGNAL(typeChanged())); QSignalSpy tnfSpy(&record, SIGNAL(typeNameFormatChanged())); QSignalSpy recordSpy(&record, SIGNAL(recordChanged())); @@ -422,14 +422,14 @@ void tst_QNdefRecord::tst_declarativeChangedSignals() QCOMPARE(recordSpy.count(), 0); record.setType("U"); - record.setTypeNameFormat(QDeclarativeNdefRecord::NfcRtd); + record.setTypeNameFormat(QQmlNdefRecord::NfcRtd); QCOMPARE(typeSpy.count(), 1); QCOMPARE(tnfSpy.count(), 1); QCOMPARE(recordSpy.count(), 0); QCOMPARE(record.type(), QString("U")); QCOMPARE(record.record().type(), QByteArray("U")); QCOMPARE(record.record().typeNameFormat(), QNdefRecord::NfcRtd); - QCOMPARE(record.typeNameFormat(), QDeclarativeNdefRecord::NfcRtd); + QCOMPARE(record.typeNameFormat(), QQmlNdefRecord::NfcRtd); record.setType("U"); //same value, no signal QCOMPARE(typeSpy.count(), 1); @@ -438,18 +438,18 @@ void tst_QNdefRecord::tst_declarativeChangedSignals() QCOMPARE(record.type(), QString("U")); QCOMPARE(record.record().type(), QByteArray("U")); QCOMPARE(record.record().typeNameFormat(), QNdefRecord::NfcRtd); - QCOMPARE(record.typeNameFormat(), QDeclarativeNdefRecord::NfcRtd); + QCOMPARE(record.typeNameFormat(), QQmlNdefRecord::NfcRtd); record.setType("blah"); record.setType("blah2"); - record.setTypeNameFormat(QDeclarativeNdefRecord::ExternalRtd); + record.setTypeNameFormat(QQmlNdefRecord::ExternalRtd); QCOMPARE(typeSpy.count(), 3); QCOMPARE(tnfSpy.count(), 2); QCOMPARE(recordSpy.count(), 0); QCOMPARE(record.type(), QString("blah2")); QCOMPARE(record.record().type(), QByteArray("blah2")); QCOMPARE(record.record().typeNameFormat(), QNdefRecord::ExternalRtd); - QCOMPARE(record.typeNameFormat(), QDeclarativeNdefRecord::ExternalRtd); + QCOMPARE(record.typeNameFormat(), QQmlNdefRecord::ExternalRtd); record.setType("Rubbish"); QCOMPARE(typeSpy.count(), 4); @@ -458,17 +458,17 @@ void tst_QNdefRecord::tst_declarativeChangedSignals() QCOMPARE(record.type(), QString("Rubbish")); QCOMPARE(record.record().type(), QByteArray("Rubbish")); QCOMPARE(record.record().typeNameFormat(), QNdefRecord::ExternalRtd); - QCOMPARE(record.typeNameFormat(), QDeclarativeNdefRecord::ExternalRtd); + QCOMPARE(record.typeNameFormat(), QQmlNdefRecord::ExternalRtd); record.setType("QQQQ"); - record.setTypeNameFormat(QDeclarativeNdefRecord::Mime); + record.setTypeNameFormat(QQmlNdefRecord::Mime); QCOMPARE(typeSpy.count(), 5); QCOMPARE(tnfSpy.count(), 3); QCOMPARE(recordSpy.count(), 0); QCOMPARE(record.type(), QString("QQQQ")); QCOMPARE(record.record().type(), QByteArray("QQQQ")); QCOMPARE(record.record().typeNameFormat(), QNdefRecord::Mime); - QCOMPARE(record.typeNameFormat(), QDeclarativeNdefRecord::Mime); + QCOMPARE(record.typeNameFormat(), QQmlNdefRecord::Mime); record.setRecord(QNdefRecord()); QCOMPARE(typeSpy.count(), 5); //setting record -> no recordChanged signal @@ -477,7 +477,7 @@ void tst_QNdefRecord::tst_declarativeChangedSignals() QCOMPARE(record.type(), QString("")); QCOMPARE(record.record().type(), QByteArray()); QCOMPARE(record.record().typeNameFormat(), QNdefRecord::Empty); - QCOMPARE(record.typeNameFormat(), QDeclarativeNdefRecord::Empty); + QCOMPARE(record.typeNameFormat(), QQmlNdefRecord::Empty); } QTEST_MAIN(tst_QNdefRecord) -- cgit v1.2.3