debugger: update manual tests

Change-Id: I88b980d4bd8c6ad7af34b6cf28cdea196d1e56d2
Reviewed-on: http://codereview.qt.nokia.com/3101
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2011-08-17 14:54:31 +02:00
committed by hjk
parent 879766d85c
commit a946538089
2 changed files with 275 additions and 303 deletions

View File

@@ -33,6 +33,8 @@
#ifndef SIMPLE_DEBUGGER_TEST_H
#define SIMPLE_DEBUGGER_TEST_H
namespace breakpoints {
struct SomeClassWithInlineConstructor
{
SomeClassWithInlineConstructor()
@@ -110,7 +112,7 @@ template <typename T>
SomeTemplatedDerivedClassWithInlineConstructor<T>::
~SomeTemplatedDerivedClassWithInlineConstructor() {}
void testInlineBreakpoints()
void testBreakpoints()
{
SomeClassWithInlineConstructor a;
SomeBaseClassWithInlineConstructor b;
@@ -118,8 +120,11 @@ void testInlineBreakpoints()
SomeTemplatedClassWithInlineConstructor<int> d;
SomeTemplatedBaseClassWithInlineConstructor<int> e;
SomeTemplatedDerivedClassWithInlineConstructor<int> f;
int i = a.a + b.a + c.a + d.a + e.a + f.a;
++i;
// <=== Break here.
dummyStatement(&a, &b, &c);
dummyStatement(&d, &e, &f);
}
} // namespace breakpoints
#endif // SIMPLE_DEBUGGER_TEST_H

View File

@@ -34,6 +34,8 @@
//template <typename T> class B; B foo() {}
void dummyStatement(const void * = 0, const void * = 0, const void * = 0) {}
#include "../simple/deep/deep/simple_gdbtest_app.h"
#include <QtCore/QDebug>
@@ -125,13 +127,6 @@
#include <stddef.h>
#endif
void dummyStatement(const void *x = 0, const void *y = 0, const void *z = 0)
{
Q_UNUSED(x);
Q_UNUSED(y);
Q_UNUSED(z);
}
namespace multibp {
template <typename T> class Vector
@@ -370,17 +365,6 @@ class D : public X, public Y
int diamond;
};
#ifndef Q_CC_RVCT
struct TestAnonymous
{
union {
struct { int i; int b; };
struct { float f; };
double d;
};
};
#endif
void testPeekAndPoke3()
{
// Anonymous structs
@@ -430,8 +414,19 @@ void testPeekAndPoke3()
}
namespace anon {
#ifndef Q_CC_RVCT
namespace { // anon
struct TestAnonymous
{
union {
struct { int i; int b; };
struct { float f; };
double d;
};
};
namespace {
struct Something
{
@@ -446,10 +441,9 @@ struct Something
int a, b;
};
} // anon
}
#endif
void testAnonymous()
{
#ifndef Q_CC_RVCT
@@ -457,18 +451,21 @@ void testAnonymous()
a.i = 1;
a.i = 2;
a.i = 3;
Q_UNUSED(a);
Something s;
// <== Break here.
// Step.
s.foo();
Q_UNUSED(s);
dummyStatement(&a, &s);
#endif
}
} // namespace anon
typedef void (*func_t)();
func_t testFunctionPointer()
{
func_t f1 = testAnonymous;
func_t f1 = anon::testAnonymous;
func_t f2 = testPeekAndPoke3;
func_t f3 = testPeekAndPoke3;
Q_UNUSED(f1);
@@ -478,6 +475,7 @@ func_t testFunctionPointer()
}
namespace qbytearray {
void testQByteArray1()
@@ -1653,15 +1651,19 @@ namespace stdvector {
v.push_back(2);
v.push_back(3);
v.push_back(4);
// <=== Break here.
dummyStatement(&v);
}
void testStdVector3()
{
Foo f;
std::vector<Foo *> v;
v.push_back(new Foo(1));
v.push_back(0);
v.push_back(new Foo(2));
// <=== Break here.
// Expand v.[0].x
dummyStatement(&v);
}
@@ -1672,6 +1674,8 @@ namespace stdvector {
flist.push_back(2);
flist.push_back(3);
flist.push_back(4);
// <=== Break here.
// Expand v.[0].x
dummyStatement(&flist);
}
@@ -1683,6 +1687,7 @@ namespace stdvector {
vec.push_back(false);
vec.push_back(true);
vec.push_back(false);
// <=== Break here.
dummyStatement(&vec);
}
@@ -1695,6 +1700,7 @@ namespace stdvector {
list.push_back(45);
vector.push_back(new std::list<int>(list));
vector.push_back(0);
// <=== Break here.
dummyStatement(&vector, &list);
}
@@ -1764,17 +1770,6 @@ void testQUrl()
(void) url;
}
void testLongEvaluation()
{
QDateTime time = QDateTime::currentDateTime();
QVector<QDateTime> bigv;
for (int i = 0; i < 10000; ++i)
bigv.append(time);
int s = bigv.size();
++s;
}
#ifdef FOP
int xxxx()
@@ -1847,18 +1842,6 @@ namespace qstringlist {
} // namespace qstringlist
Foo testStruct()
{
Foo f(2);
f.doit();
f.doit();
f.doit();
Foo f1 = f;
f1.doit();
return f1;
}
namespace formats {
void testString()
@@ -2420,27 +2403,6 @@ void testMemoryView()
a[i] = i;
}
void testUninitialized()
{
QString s;
QStringList sl;
QMap<int, int> mii;
QMap<QString, QString> mss;
QHash<int, int> hii;
QHash<QString, QString> hss;
QList<int> li;
QVector<int> vi;
QStack<int> si;
std::string ss;
std::map<int, int> smii;
std::map<std::string, std::string> smss;
std::list<int> sli;
std::list<std::string> ssl;
std::vector<int> svi;
std::stack<int> ssi;
}
void testEndlessRecursion()
{
testEndlessRecursion();
@@ -2626,6 +2588,16 @@ namespace basic {
++t2;
}
void testStruct()
{
Foo f(2);
f.doit();
f.doit();
f.doit();
// <=== Break here.
dummyStatement(&f);
}
void testUninitialized()
{
// This tests the display of uninitialized data.
@@ -2766,6 +2738,17 @@ namespace basic {
dummyStatement(&c, &d);
}
void testLongEvaluation()
{
QDateTime time = QDateTime::currentDateTime();
QVector<QDateTime> bigv;
for (int i = 0; i < 10000; ++i)
bigv.append(time);
// <== Break here.
// Expand bigv.
dummyStatement(&bigv);
}
void testBasic()
{
testArray1();
@@ -2779,6 +2762,7 @@ namespace basic {
testAlphabeticSorting();
testTypedef();
testPtrTypedef();
testStruct();
testUninitialized();
testTypeFormats();
testStringWithNewline();
@@ -2786,32 +2770,12 @@ namespace basic {
testColoredMemoryView();
testReference1();
testReference2();
testLongEvaluation();
}
} // namespace basic
void testStuff()
{
using namespace std;
typedef map<string, list<string> > map_t;
map_t m;
m["one"].push_back("a");
m["one"].push_back("b");
m["one"].push_back("c");
m["two"].push_back("1");
m["two"].push_back("2");
m["two"].push_back("3");
map_t::const_iterator i = m.begin();
vector<int> vec;
vec.push_back(1);
vec.push_back(2);
pair<vector<int>, vector<int> > a(pair<vector<int>,vector<int> >(vec, vec));
i++;
}
void testStuff2()
{
QList<QList<int> > list1;
@@ -2992,6 +2956,9 @@ void testFork()
ba.append('x');
}
namespace mpi {
struct structdata
{
int ints[8];
@@ -3080,6 +3047,8 @@ void testMPI()
}
} // namespace mpi
//namespace kr {
@@ -3255,7 +3224,7 @@ namespace bug4904 {
double dvalue;
};
int test4904()
void test4904()
{
QMap<int, CustomStruct> map;
CustomStruct cs1;
@@ -3266,11 +3235,11 @@ namespace bug4904 {
map.insert(cs1.id, cs1);
map.insert(cs2.id, cs2);
QMap<int, CustomStruct>::iterator it = map.begin();
int n = map.size(); // <=== Break here.
// <=== Break here.
// - expand map/[0]/value
// - verify map[0].key == -1
// - verify map[0].value.id == -1
return n;
dummyStatement(&it);
}
} // namespace bug4904
@@ -3282,16 +3251,17 @@ namespace bug5046 {
struct Foo { int a, b, c; };
int test5046()
void test5046()
{
Foo f;
f.a = 1;
f.b = 2;
f.c = 3;
f.a = 4; // <= Break here.
f.a = 4;
// <= Break here.
// - pop up main editor tooltip over 'f'
// - verify that the entry is expandable, and expansion works
return f.a;
dummyStatement(&f);
}
} // namespace bug5046
@@ -3370,14 +3340,13 @@ namespace qc42170 {
struct Point : Object
{
Point(double x_, double y_, int id_) : Object(id_), x(x_), y(y_) {}
Point(double x_, double y_) : Object(1), x(x_), y(y_) {}
double x, y;
};
struct Circle : Point
{
Circle(double x_, double y_, double r_, int id_)
: Point(x_, y_, id_), r(r_) {}
Circle(double x_, double y_, double r_) : Point(x_, y_), r(r_) { id = 2; }
double r;
};
@@ -3391,11 +3360,10 @@ namespace qc42170 {
void test42170()
{
Circle *circle = new Circle(1.5, -2.5, 3.0, 15);
Circle *circle = new Circle(1.5, -2.5, 3.0);
Object *obj = circle;
helper(circle);
helper(obj);
dummyStatement(obj);
}
} // namespace qc42170
@@ -3501,6 +3469,26 @@ namespace varargs {
int main(int argc, char *argv[])
{
std::string s;
s = "hallo";
s += "hallo";
QVector<int> qv;
qv.push_back(2);
std::vector<int> v;
v.push_back(2);
QStringList list;
list << "aaa" << "bbb" << "cc";
QList<const char *> list2;
list2 << "foo";
list2 << "bar";
list2 << 0;
list2 << "baz";
list2 << 0;
qhostaddress::testQHostAddress();
varargs::testVaList();
cp42895::test42895();
@@ -3518,14 +3506,10 @@ int main(int argc, char *argv[])
//bug4497::test4497();
eigen::testEigen();
kr::testKR();
std::string s;
s = "hallo";
s += "hallo";
qxml::testQXmlAttributes();
qregexp::testQRegExp();
testInlineBreakpoints();
testLongEvaluation();
testMPI();
breakpoints::testBreakpoints();
mpi::testMPI();
qobjectdata::testQObjectData();
//testQSettings();
//testWCout0();
@@ -3535,10 +3519,9 @@ int main(int argc, char *argv[])
qrect::testGeometry();
qregion::testQRegion();
basic::testBasic();
testStuff();
testPeekAndPoke3();
testFunctionPointer();
testAnonymous();
anon::testAnonymous();
//testEndlessLoop();
//testEndlessRecursion();
testQStack();
@@ -3551,22 +3534,6 @@ int main(int argc, char *argv[])
testQHash1();
testSignalSlot(argc, argv);
QVector<int> qv;
qv.push_back(2);
std::vector<int> v;
v.push_back(2);
QStringList list;
list << "aaa" << "bbb" << "cc";
QList<const char *> list2;
list2 << "foo";
list2 << "bar";
list2 << 0;
list2 << "baz";
list2 << 0;
testQStandardItemModel();
testFunction();
testQImage();
@@ -3602,7 +3569,7 @@ int main(int argc, char *argv[])
testQSharedPointer();
qstringlist::testQStringList();
testQScriptValue(argc, argv);
testStruct();
basic::testStruct();
//qthread::testQThread();
qvariant::testQVariant();
qvector::testQVector();