From 2d7b0d09ae4828356176d966fd0f66647c50900e Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 21 Nov 2013 22:57:22 +0100 Subject: Debugger: Add manual test for lambda Change-Id: I288826b0aed94de1f42a9eaddf3d40575e4e13e1 Reviewed-by: hjk --- tests/manual/debugger/simple/simple_test_app.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/manual/debugger/simple/simple_test_app.cpp') diff --git a/tests/manual/debugger/simple/simple_test_app.cpp b/tests/manual/debugger/simple/simple_test_app.cpp index ba55395eb3..4cb223d0c7 100644 --- a/tests/manual/debugger/simple/simple_test_app.cpp +++ b/tests/manual/debugger/simple/simple_test_app.cpp @@ -3068,6 +3068,24 @@ namespace stdptr { } // namespace stdptr +namespace lambda { + + void testLambda() + { +#ifdef USE_CXX11 + std::string x; + auto f = [&] () -> const std::string & { + int z = x.size(); + return x; + }; + auto c = f(); + BREAK_HERE; + dummyStatement(&x, &f, &c); +#endif + } + +} // namespace lambda + namespace stdset { void testStdSetInt() @@ -6859,6 +6877,7 @@ int main(int argc, char *argv[]) stdstring::testStdString(); stdvector::testStdVector(); stdptr::testStdPtr(); + lambda::testLambda(); qbytearray::testQByteArray(); qdatetime::testDateTime(); -- cgit v1.2.1 From ee8ddc356448ee1a6ed1147391de599779ef9411 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 27 Nov 2013 10:00:58 +0100 Subject: Debugger: Restrict std::unordered_map manual test to C++11 Change-Id: I13788acb6cfa9a659482d64bead10dd27e71fade Reviewed-by: hjk --- tests/manual/debugger/simple/simple_test_app.cpp | 216 +++++++++++++++++++++++ 1 file changed, 216 insertions(+) (limited to 'tests/manual/debugger/simple/simple_test_app.cpp') diff --git a/tests/manual/debugger/simple/simple_test_app.cpp b/tests/manual/debugger/simple/simple_test_app.cpp index 4cb223d0c7..f7ce97ed5f 100644 --- a/tests/manual/debugger/simple/simple_test_app.cpp +++ b/tests/manual/debugger/simple/simple_test_app.cpp @@ -176,6 +176,7 @@ void dummyStatement(...) {} #if USE_CXX11 #include +#include #endif #include #include @@ -2802,6 +2803,220 @@ namespace stdlist { } // namespace stdlist +namespace stdunorderedmap { + +#if USE_CXX11 + void testStdUnorderedMapStringFoo() + { + // This is not supposed to work with the compiled dumpers. + std::unordered_map map; + map["22.0"] = Foo(22); + map["33.0"] = Foo(33); + map["44.0"] = Foo(44); + BREAK_HERE; + // Expand map map.0 map.0.second map.2 map.2.second. + // Check map <3 items> std::unordered_map. + // Check map.0 std::pair. + // Check map.0.first "22.0" QString. + // CheckType map.0.second Foo. + // Check map.0.second.a 22 int. + // Check map.1 std::pair. + // Check map.2.first "44.0" QString. + // CheckType map.2.second Foo. + // Check map.2.second.a 44 int. + // Continue. + dummyStatement(&map); + } + + void testStdUnorderedMapCharStarFoo() + { + std::unordered_map map; + map["22.0"] = Foo(22); + map["33.0"] = Foo(33); + BREAK_HERE; + // Expand map map.0 map.0.first map.0.second map.1 map.1.second. + // Check map <2 items> std::unordered_map. + // Check map.0 std::pair. + // CheckType map.0.first char *. + // Check map.0.first.*first 50 '2' char. + // CheckType map.0.second Foo. + // Check map.0.second.a 22 int. + // Check map.1 std::pair. + // CheckType map.1.first char *. + // Check map.1.first.*first 51 '3' char. + // CheckType map.1.second Foo. + // Check map.1.second.a 33 int. + // Continue. + dummyStatement(&map); + } + + void testStdUnorderedMapUIntUInt() + { + std::unordered_map map; + map[11] = 1; + map[22] = 2; + BREAK_HERE; + // Expand map. + // Check map <2 items> std::unordered_map. + // Check map.11 1 unsigned int. + // Check map.22 2 unsigned int. + // Continue. + dummyStatement(&map); + } + + void testStdUnorderedMapUIntStringList() + { +#if 0 + std::unordered_map map; + map[11] = QStringList() << "11"; + map[22] = QStringList() << "22"; + BREAK_HERE; + // Expand map map.0 map.0.first map.0.second map.1 map.1.second. + // Check map <2 items> std::unordered_map. + // Check map.0 std::pair. + // Check map.0.first 11 unsigned int. + // Check map.0.second <1 items> QStringList. + // Check map.0.second.0 "11" QString. + // Check map.1 std::pair. + // Check map.1.first 22 unsigned int. + // Check map.1.second <1 items> QStringList. + // Check map.1.second.0 "22" QString. + // Continue. + dummyStatement(&map); +#endif + } + + void testStdUnorderedMapUIntStringListTypedef() + { +#if 0 + typedef std::unordered_map T; + T map; + map[11] = QStringList() << "11"; + map[22] = QStringList() << "22"; + BREAK_HERE; + // Check map <2 items> stdmap::T. + // Continue. + dummyStatement(&map); +#endif + } + + void testStdUnorderedMapUIntFloat() + { + std::unordered_map map; + map[11] = 11.0; + map[22] = 22.0; + BREAK_HERE; + // Expand map. + // Check map <2 items> std::unordered_map. + // Check map.11 11 float. + // Check map.22 22 float. + // Continue. + dummyStatement(&map); + } + + void testStdUnorderedMapUIntFloatIterator() + { + typedef std::unordered_map Map; + Map map; + map[11] = 11.0; + map[22] = 22.0; + map[33] = 33.0; + map[44] = 44.0; + map[55] = 55.0; + map[66] = 66.0; + + Map::iterator it1 = map.begin(); + Map::iterator it2 = it1; ++it2; + Map::iterator it3 = it2; ++it3; + Map::iterator it4 = it3; ++it4; + Map::iterator it5 = it4; ++it5; + Map::iterator it6 = it5; ++it6; + + BREAK_HERE; + // Expand map. + // Check map <6 items> stdmap::Map. + // Check map.11 11 float. + // Check it1.first 11 int. + // Check it1.second 11 float. + // Check it6.first 66 int. + // Check it6.second 66 float. + // Continue. + dummyStatement(&map, &it1, &it2, &it3, &it4, &it5, &it6); + } + + void testStdUnorderedMapStringFloat() + { + std::unordered_map map; + map["11.0"] = 11.0; + map["22.0"] = 22.0; + BREAK_HERE; + // Expand map map.0 map.1. + // Check map <2 items> std::unordered_map. + // Check map.0 std::pair. + // Check map.0.first "11.0" QString. + // Check map.0.second 11 float. + // Check map.1 std::pair. + // Check map.1.first "22.0" QString. + // Check map.1.second 22 float. + // Continue. + dummyStatement(&map); + } + + void testStdUnorderedMapIntString() + { + std::unordered_map map; + map[11] = "11.0"; + map[22] = "22.0"; + BREAK_HERE; + // Expand map map.0 map.1. + // Check map <2 items> std::unordered_map. + // Check map.0 std::pair. + // Check map.0.first 11 int. + // Check map.0.second "11.0" QString. + // Check map.1 std::pair. + // Check map.1.first 22 int. + // Check map.1.second "22.0" QString. + // Continue. + dummyStatement(&map); + } + + void testStdUnorderedMapStringPointer() + { + QObject ob; + std::unordered_map > map; + map["Hallo"] = QPointer(&ob); + map["Welt"] = QPointer(&ob); + map["."] = QPointer(&ob); + BREAK_HERE; + // Expand map map.0 map.2. + // Check map <3 items> std::unordered_map>. + // Check map.0 std::pair>. + // Check map.0.first "." QString. + // CheckType map.0.second QPointer. + // Check map.2 std::pair>. + // Check map.2.first "Welt" QString. + // Continue. + dummyStatement(&map); + } +#endif + + void testStdUnorderedMap() + { +#if USE_CXX11 + testStdUnorderedMapStringFoo(); + testStdUnorderedMapCharStarFoo(); + testStdUnorderedMapUIntUInt(); + testStdUnorderedMapUIntStringList(); + testStdUnorderedMapUIntStringListTypedef(); + testStdUnorderedMapUIntFloat(); + testStdUnorderedMapUIntFloatIterator(); + testStdUnorderedMapStringFloat(); + testStdUnorderedMapIntString(); + testStdUnorderedMapStringPointer(); +#endif + } + +} // namespace stdunorderedmap namespace stdmap { @@ -6871,6 +7086,7 @@ int main(int argc, char *argv[]) stdlist::testStdList(); stdhashset::testStdHashSet(); stdmap::testStdMap(); + stdunorderedmap::testStdUnorderedMap(); stdset::testStdSet(); stdstack::testStdStack(); stdstream::testStdStream(); -- cgit v1.2.1 From 242cb179191c2fa5c88561b4d28b693868fbd4b8 Mon Sep 17 00:00:00 2001 From: hjk Date: Sat, 30 Nov 2013 23:46:25 +0100 Subject: Debugger: Adjust QDateTime dumper for Qt 5.2 Change-Id: I53a5701c9d1791e2705eafb258ff440f97e53b87 Reviewed-by: John Layt Reviewed-by: hjk --- tests/manual/debugger/simple/simple_test_app.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/manual/debugger/simple/simple_test_app.cpp') diff --git a/tests/manual/debugger/simple/simple_test_app.cpp b/tests/manual/debugger/simple/simple_test_app.cpp index f7ce97ed5f..ddadcea05c 100644 --- a/tests/manual/debugger/simple/simple_test_app.cpp +++ b/tests/manual/debugger/simple/simple_test_app.cpp @@ -5475,8 +5475,11 @@ namespace basic { void testLongEvaluation1() { + QTimeZone tz("UTC+05:00"); QDateTime time = QDateTime::currentDateTime(); const int N = 10000; + QDateTime x = time; + x.setTimeZone(tz); QDateTime bigv[N]; for (int i = 0; i < 10000; ++i) { bigv[i] = time; -- cgit v1.2.1