diff options
author | Christian Stenger <christian.stenger@digia.com> | 2014-05-22 15:57:33 +0200 |
---|---|---|
committer | Christian Stenger <christian.stenger@digia.com> | 2014-05-23 07:48:54 +0200 |
commit | fc58d0abc8a59ccc3f991c52da57b64ae790bb4b (patch) | |
tree | 21392e64c5764424d57459e2c1cc65cdaf8fb6c8 /tests/auto/debugger | |
parent | ca3c03c4d343cb21d9de1a4d88e5af465a1effa6 (diff) | |
download | qt-creator-fc58d0abc8a59ccc3f991c52da57b64ae790bb4b.tar.gz |
Tests: Fix QUrl test for Qt4...
...by adding capabilities that allow a better differentiation between
Qt4 and Qt5 object structures.
Change-Id: I025d8301c13922e369862eefaad848bbecc76030
Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'tests/auto/debugger')
-rw-r--r-- | tests/auto/debugger/tst_dumpers.cpp | 62 |
1 files changed, 50 insertions, 12 deletions
diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 7742c1eca7..e893da1e39 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -406,13 +406,13 @@ struct Check : CheckBase Check(const QByteArray &iname, const Value &value, const Type &type) : iname(iname), expectedName(nameFromIName(iname)), - expectedValue(value), expectedType(type) + expectedValue(value), expectedType(type), qtVersionMajor(0) {} Check(const QByteArray &iname, const Name &name, const Value &value, const Type &type) : iname(iname), expectedName(name), - expectedValue(value), expectedType(type) + expectedValue(value), expectedType(type), qtVersionMajor(0) {} bool matchesEngine(DebuggerEngine engine) const @@ -430,6 +430,7 @@ struct Check : CheckBase Name expectedName; Value expectedValue; Type expectedType; + int qtVersionMajor; }; struct CheckType : public Check @@ -444,6 +445,25 @@ struct CheckType : public Check {} }; +struct Check4 : Check +{ + Check4(const QByteArray &iname, const Value &value, const Type &type) + : Check(iname, value, type) { qtVersionMajor = 4; } + + Check4(const QByteArray &iname, const Name &name, const Value &value, const Type &type) + : Check(iname, name, value, type) { qtVersionMajor = 4; } +}; + +struct Check5 : Check +{ + Check5(const QByteArray &iname, const Value &value, const Type &type) + : Check(iname, value, type) { qtVersionMajor = 5; } + + Check5(const QByteArray &iname, const Name &name, const Value &value, const Type &type) + : Check(iname, name, value, type) { qtVersionMajor = 5; } + +}; + struct Profile { Profile(const QByteArray &contents) : contents(contents) {} @@ -1272,6 +1292,12 @@ void tst_Dumpers::dumper() //qDebug() << "CHECKS" << i << check.iname; if ("local." + check.iname == item.iname) { data.checks.removeAt(i); + if (context.qtVersion) { + if (check.qtVersionMajor == 5 && context.qtVersion < 0x050000) + continue; + if (check.qtVersionMajor == 4 && context.qtVersion >= 0x050000) + continue; + } if (check.matchesEngine(m_debuggerEngine)) { //qDebug() << "USING MATCHING TEST FOR " << item.iname; if (!check.expectedName.matches(item.name.toLatin1(), context)) { @@ -2796,17 +2822,29 @@ void tst_Dumpers::dumper_data() + CoreProfile() + // check Qt5 internal structure for QUrl + Check("url0", "<invalid>", "@QUrl") - + Check("url1", UnsubstitutedValue("\"http://foo@qt-project.org:10/have_fun\""), "@QUrl") - + Check("url1.port", "10", "int") - + Check("url1.scheme", "\"http\"", "@QString") - + Check("url1.userName", "\"foo\"", "@QString") - + Check("url1.password", "\"\"", "@QString") - + Check("url1.host", "\"qt-project.org\"", "@QString") - + Check("url1.path", "\"/have_fun\"", "@QString") - + Check("url1.query", "\"\"", Type4("@QByteArray")) - + Check("url1.query", "\"\"", Type5("@QString")) - + Check("url1.fragment", "\"\"", "@QString"); + + Check5("url1", UnsubstitutedValue("\"http://foo@qt-project.org:10/have_fun\""), "@QUrl") + + Check5("url1.port", "10", "int") + + Check5("url1.scheme", "\"http\"", "@QString") + + Check5("url1.userName", "\"foo\"", "@QString") + + Check5("url1.password", "\"\"", "@QString") + + Check5("url1.host", "\"qt-project.org\"", "@QString") + + Check5("url1.path", "\"/have_fun\"", "@QString") + + Check5("url1.query", "\"\"", "@QString") + + Check5("url1.fragment", "\"\"", "@QString") + + // check Qt4 internal structure for QUrl + + Check4("url1", "", "@QUrl") + + Check4("url1.d", "", "@QUrlPrivate") + + Check4("url1.d.port", "10", "int") + + Check4("url1.d.scheme", "\"http\"", "@QString") + + Check4("url1.d.userName", "\"foo\"", "@QString") + + Check4("url1.d.password", "\"\"", "@QString") + + Check4("url1.d.host", "\"qt-project.org\"", "@QString") + + Check4("url1.d.path", "\"/have_fun\"", "@QString") + + Check4("url1.query", "\"\"", "@QByteArray") + + Check4("url1.d.fragment", "\"\"", "@QString"); QByteArray expected1 = "\"AAA"; |