diff options
author | Tobias Hunger <tobias.hunger@digia.com> | 2012-10-09 16:01:56 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@digia.com> | 2012-10-10 10:35:41 +0200 |
commit | ae2a600af823c1c1912d0da5dd1be3e8e7d04945 (patch) | |
tree | 84449bfd1bd016538f594cff1ee0e628d3516774 | |
parent | f3d30dfba177ec7e165f0d9ced3587ed16ed605c (diff) | |
download | qt-creator-ae2a600af823c1c1912d0da5dd1be3e8e7d04945.tar.gz |
sdktool: Fix type of device type and the unit tests
Change-Id: I64b817c0bd6c454d4f9cb423720c8baed8490fea
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
-rw-r--r-- | src/tools/sdktool/addkeysoperation.cpp | 2 | ||||
-rw-r--r-- | src/tools/sdktool/addkitoperation.cpp | 22 | ||||
-rw-r--r-- | src/tools/sdktool/addkitoperation.h | 2 | ||||
-rw-r--r-- | src/tools/sdktool/addqtoperation.cpp | 4 | ||||
-rw-r--r-- | src/tools/sdktool/rmkitoperation.cpp | 4 |
5 files changed, 17 insertions, 17 deletions
diff --git a/src/tools/sdktool/addkeysoperation.cpp b/src/tools/sdktool/addkeysoperation.cpp index e53cdb779d..86308591f8 100644 --- a/src/tools/sdktool/addkeysoperation.cpp +++ b/src/tools/sdktool/addkeysoperation.cpp @@ -112,7 +112,7 @@ bool AddKeysOperation::test() const data.append(KeyValuePair(QLatin1String("newsub/1/2.1/3/qbytearray"), QString::fromLatin1("QByteArray:test array."))); QVariantMap result = addKeys(testMap, data); - if (result.count() != 8) + if (result.count() != 9) return false; // subkeys: diff --git a/src/tools/sdktool/addkitoperation.cpp b/src/tools/sdktool/addkitoperation.cpp index 6abb9f7bec..917ea48760 100644 --- a/src/tools/sdktool/addkitoperation.cpp +++ b/src/tools/sdktool/addkitoperation.cpp @@ -208,7 +208,7 @@ int AddKitOperation::execute() const map = initializeKits(); map = addKit(map, m_id, m_displayName, m_icon, m_debuggerEngine, m_debugger, - m_deviceType, m_sysRoot, m_tc, m_qt, m_mkspec, m_extra); + m_deviceType.toUtf8(), m_sysRoot, m_tc, m_qt, m_mkspec, m_extra); if (map.isEmpty()) return -2; @@ -230,9 +230,9 @@ bool AddKitOperation::test() const || map.value(QLatin1String(DEFAULT)).toInt() != -1) return false; - map = addKit(map, QLatin1String("testId"), QLatin1String("Test Qt Version"), QLatin1String("/tmp/icon.png"), + map = addKit(map, QLatin1String("testId"), QLatin1String("Test Kit"), QLatin1String("/tmp/icon.png"), 1, QLatin1String("/usr/bin/gdb-test"), - QLatin1String("Desktop"), QString(), + QByteArray("Desktop"), QString(), QLatin1String("{some-tc-id}"), QLatin1String("{some-qt-id}"), QLatin1String("unsupported/mkspec"), KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); @@ -247,11 +247,11 @@ bool AddKitOperation::test() const return false; QVariantMap profile0 = map.value(QLatin1String("Profile.0")).toMap(); - if (profile0.count() != 6 + if (profile0.count() != 5 || !profile0.contains(QLatin1String(ID)) || profile0.value(QLatin1String(ID)).toString() != QLatin1String("testId") || !profile0.contains(QLatin1String(DISPLAYNAME)) - || profile0.value(QLatin1String(DISPLAYNAME)).toString() != QLatin1String("Test Qt Version") + || profile0.value(QLatin1String(DISPLAYNAME)).toString() != QLatin1String("Test Kit") || !profile0.contains(QLatin1String(AUTODETECTED)) || profile0.value(QLatin1String(AUTODETECTED)).toBool() != true) return false; @@ -259,16 +259,16 @@ bool AddKitOperation::test() const // Ignore existing ids: QVariantMap result = addKit(map, QLatin1String("testId"), QLatin1String("Test Qt Version X"), QLatin1String("/tmp/icon3.png"), 1, QLatin1String("/usr/bin/gdb-test3"), - QLatin1String("Desktop"), QString(), + QByteArray("Desktop"), QString(), QLatin1String("{some-tc-id3}"), QLatin1String("{some-qt-id3}"), QLatin1String("unsupported/mkspec3"), KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue3")))); if (!result.isEmpty()) return false; // Make sure name is unique: - map = addKit(map, QLatin1String("testId2"), QLatin1String("Test Qt Version"), QLatin1String("/tmp/icon2.png"), + map = addKit(map, QLatin1String("testId2"), QLatin1String("Test Kit2"), QLatin1String("/tmp/icon2.png"), 1, QLatin1String("/usr/bin/gdb-test2"), - QLatin1String("Desktop"), QString(), + QByteArray("Desktop"), QString(), QLatin1String("{some-tc-id2}"), QLatin1String("{some-qt-id2}"), QLatin1String("unsupported/mkspec2"), KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue2")))); if (map.count() != 5 @@ -285,11 +285,11 @@ bool AddKitOperation::test() const return false; QVariantMap profile1 = map.value(QLatin1String("Profile.1")).toMap(); - if (profile1.count() != 6 + if (profile1.count() != 5 || !profile1.contains(QLatin1String(ID)) || profile1.value(QLatin1String(ID)).toString() != QLatin1String("testId2") || !profile1.contains(QLatin1String(DISPLAYNAME)) - || profile1.value(QLatin1String(DISPLAYNAME)).toString() != QLatin1String("Test Qt Version2") + || profile1.value(QLatin1String(DISPLAYNAME)).toString() != QLatin1String("Test Kit2") || !profile1.contains(QLatin1String(AUTODETECTED)) || profile1.value(QLatin1String(AUTODETECTED)).toBool() != true) return false; @@ -301,7 +301,7 @@ bool AddKitOperation::test() const QVariantMap AddKitOperation::addKit(const QVariantMap &map, const QString &id, const QString &displayName, const QString &icon, const quint32 &debuggerType, const QString &debugger, - const QString &deviceType, const QString &sysRoot, + const QByteArray &deviceType, const QString &sysRoot, const QString &tc, const QString &qt, const QString &mkspec, const KeyValuePairList &extra) { diff --git a/src/tools/sdktool/addkitoperation.h b/src/tools/sdktool/addkitoperation.h index 4acc06b457..5585fadec3 100644 --- a/src/tools/sdktool/addkitoperation.h +++ b/src/tools/sdktool/addkitoperation.h @@ -54,7 +54,7 @@ public: static QVariantMap addKit(const QVariantMap &map, const QString &id, const QString &displayName, const QString &icon, const quint32 &debuggerType, const QString &debugger, - const QString &deviceType, const QString &sysRoot, + const QByteArray &deviceType, const QString &sysRoot, const QString &tc, const QString &qt, const QString &mkspec, const KeyValuePairList &extra); diff --git a/src/tools/sdktool/addqtoperation.cpp b/src/tools/sdktool/addqtoperation.cpp index 57f44e3c64..c973c82520 100644 --- a/src/tools/sdktool/addqtoperation.cpp +++ b/src/tools/sdktool/addqtoperation.cpp @@ -155,7 +155,7 @@ bool AddQtOperation::test() const return false; QVariantMap version0 = map.value(QLatin1String("QtVersion.0")).toMap(); - if (version0.count() != 6 + if (version0.count() != 7 || !version0.contains(QLatin1String(ID)) || version0.value(QLatin1String(ID)).toInt() != -1 || !version0.contains(QLatin1String(DISPLAYNAME)) @@ -194,7 +194,7 @@ bool AddQtOperation::test() const return false; QVariantMap version1 = map.value(QLatin1String("QtVersion.1")).toMap(); - if (version1.count() != 6 + if (version1.count() != 7 || !version1.contains(QLatin1String(ID)) || version1.value(QLatin1String(ID)).toInt() != -1 || !version1.contains(QLatin1String(DISPLAYNAME)) diff --git a/src/tools/sdktool/rmkitoperation.cpp b/src/tools/sdktool/rmkitoperation.cpp index 2fe2f3df2b..417c8f7d87 100644 --- a/src/tools/sdktool/rmkitoperation.cpp +++ b/src/tools/sdktool/rmkitoperation.cpp @@ -100,7 +100,7 @@ bool RmKitOperation::test() const QLatin1String("testId"), QLatin1String("Test Qt Version"), QLatin1String("/tmp/icon.png"), 1, QLatin1String("/usr/bin/gdb-test"), - QLatin1String("Desktop"), QString(), + QByteArray("Desktop"), QString(), QLatin1String("{some-tc-id}"), QLatin1String("{some-qt-id}"), QLatin1String("unsupported/mkspec"), KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue")))); @@ -108,7 +108,7 @@ bool RmKitOperation::test() const AddKitOperation::addKit(map, QLatin1String("testId2"), QLatin1String("Test Qt Version"), QLatin1String("/tmp/icon2.png"), 1, QLatin1String("/usr/bin/gdb-test2"), - QLatin1String("Desktop"), QString(), + QByteArray("Desktop"), QString(), QLatin1String("{some-tc-id2}"), QLatin1String("{some-qt-id2}"), QLatin1String("unsupported/mkspec2"), KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue2")))); |