summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Rosendahl <ext-sami.1.rosendahl@nokia.com>2012-01-17 11:32:03 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-01-25 12:29:00 (GMT)
commitb34d903466a34668973030341e2f12d2b481ed58 (patch)
tree0e109761508b6595df94d0e70668b59f7f8e6084
parent7288ea511d21c86d388507287ddb5e494bbab2a0 (diff)
downloadQt-b34d903466a34668973030341e2f12d2b481ed58.zip
Qt-b34d903466a34668973030341e2f12d2b481ed58.tar.gz
Qt-b34d903466a34668973030341e2f12d2b481ed58.tar.bz2
Fix failure of tst_QDBusMarshall::demarshallPrimitives()
Commit e20eaed5c1968e32eca97cf449fa588cfab35a5d was merged to Qt 4.8 although the originating merge request https://qt.gitorious.org/qt/qt/merge_requests/1469 targeted Qt 4.7. This resulted in test data setup and execution failure for test case tst_QDBusMarshall::demarshallPrimitives() due to changes in the test in Qt 4.8. This commit refactors the sendBasic_data() test data function to support separate initialization of basic numeric and basic string data to be reused by demarshallPrimitives_data(). Same refactoring was done in Qt5 and this commit aligns Qt4.8 commit e20eaed5c1968e32eca97cf449fa588cfab35a5d with Qt5. Change-Id: I10d0fce34c99c7b3b6247c503634b55a93f7d3b2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp b/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp
index f02aff3..cc5e68d 100644
--- a/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp
+++ b/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp
@@ -162,13 +162,15 @@ int tst_QDBusMarshall::fileDescriptorForTest()
return tempFile.handle();
}
-void tst_QDBusMarshall::sendBasic_data()
+void addBasicTypesColumns()
{
QTest::addColumn<QVariant>("value");
QTest::addColumn<QString>("sig");
QTest::addColumn<QString>("stringResult");
+}
- // basic types:
+void basicNumericTypes_data()
+{
QTest::newRow("bool") << QVariant(false) << "b" << "false";
#if 1
QTest::newRow("bool2") << QVariant(true) << "b" << "true";
@@ -180,11 +182,24 @@ void tst_QDBusMarshall::sendBasic_data()
QTest::newRow("int64") << QVariant(Q_INT64_C(3)) << "x" << "3";
QTest::newRow("uint64") << QVariant(Q_UINT64_C(4)) << "t" << "4";
QTest::newRow("double") << QVariant(42.5) << "d" << "42.5";
+}
+
+void basicStringTypes_data()
+{
QTest::newRow("string") << QVariant("ping") << "s" << "\"ping\"";
QTest::newRow("objectpath") << qVariantFromValue(QDBusObjectPath("/org/kde")) << "o" << "[ObjectPath: /org/kde]";
QTest::newRow("signature") << qVariantFromValue(QDBusSignature("g")) << "g" << "[Signature: g]";
QTest::newRow("emptystring") << QVariant("") << "s" << "\"\"";
QTest::newRow("nullstring") << QVariant(QString()) << "s" << "\"\"";
+}
+
+void tst_QDBusMarshall::sendBasic_data()
+{
+ addBasicTypesColumns();
+
+ // basic types:
+ basicNumericTypes_data();
+ basicStringTypes_data();
if (fileDescriptorPassing)
QTest::newRow("file-descriptor") << qVariantFromValue(QDBusUnixFileDescriptor(fileDescriptorForTest())) << "h" << "[Unix FD: valid]";
@@ -1173,7 +1188,10 @@ void tst_QDBusMarshall::receiveUnknownType()
void tst_QDBusMarshall::demarshallPrimitives_data()
{
- sendBasic_data();
+ addBasicTypesColumns();
+
+ // Primitive types, excluding strings and FD
+ basicNumericTypes_data();
}
template<class T>