From 7d5ef1fbf042d0751ad98a9b1a4af878fefc28fe Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Mon, 4 Jan 2010 13:16:10 +0100 Subject: [PATCH] debugger: add a manual test with a object reference --- tests/manual/gdbdebugger/simple/app.cpp | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/manual/gdbdebugger/simple/app.cpp b/tests/manual/gdbdebugger/simple/app.cpp index a40642dea03..eec1ef5833d 100644 --- a/tests/manual/gdbdebugger/simple/app.cpp +++ b/tests/manual/gdbdebugger/simple/app.cpp @@ -27,6 +27,11 @@ ** **************************************************************************/ +//#include <complex> + + +//template <typename T> class B; B foo() {} + #include <QtCore/QDebug> #include <QtCore/QDateTime> #include <QtCore/QDir> @@ -69,6 +74,18 @@ #include <windows.h> #endif +template <typename T> class Vector +{ +public: + explicit Vector(int size) : m_size(size), m_data(new T[size]) {} + ~Vector() { delete [] m_data; } + //... +private: + int m_size; + T *m_data; +}; + + uint qHash(const QMap<int, int> &) { @@ -1347,8 +1364,22 @@ void testEndlessRecursion() testEndlessRecursion(); } +QString fooxx() +{ + return "bababa"; +} + +int testReference() +{ + QString a = "hello"; + const QString &b = fooxx(); + QString c = "world"; + return a.size() + b.size() + c.size(); +} + int main(int argc, char *argv[]) { + testReference(); //testEndlessRecursion(); testQStack(); testUninitialized(); -- GitLab