summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2011-11-28 18:57:25 +0100
committerBill King <bill.king@nokia.com>2011-11-29 13:43:59 +0100
commit59359905bf7820c91ae5b61aeeb46e9e5da52679 (patch)
treea770a2c7bbdb74d1d9309b92651cea066c2af940 /tests
parentacf3ee7ca6d305f3a2dd10f4d85918d5e4c8a323 (diff)
downloadqt-creator-59359905bf7820c91ae5b61aeeb46e9e5da52679.tar.gz
debugger: add manual test for dumping derived classes using base pointer
Change-Id: I65c5977fc16083cf09a123c6beadbc156a9f29c7 Reviewed-by: Bill King <bill.king@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/manual/debugger/simple/simple_test_app.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/manual/debugger/simple/simple_test_app.cpp b/tests/manual/debugger/simple/simple_test_app.cpp
index 1b1962652c..ee6ce38d86 100644
--- a/tests/manual/debugger/simple/simple_test_app.cpp
+++ b/tests/manual/debugger/simple/simple_test_app.cpp
@@ -4115,6 +4115,53 @@ namespace varargs {
} // namespace varargs
+namespace gdb13393 {
+
+ struct Base {
+ Base() : a(1) {}
+ virtual ~Base() {} // Enforce type to have RTTI
+ int a;
+ };
+
+
+ struct Derived : public Base {
+ Derived() : b(2) {}
+ int b;
+ };
+
+ struct S
+ {
+ Base *ptr;
+ const Base *ptrConst;
+ Base &ref;
+ const Base &refConst;
+
+ S(Derived &d)
+ : ptr(&d), ptrConst(&d), ref(d), refConst(d)
+ {}
+ };
+
+ void test13393()
+ {
+ Derived d;
+ S s(d);
+ Base *ptr = &d;
+ const Base *ptrConst = &d;
+ Base& ref = d;
+ const Base &refConst = d;
+ Base **ptrToPtr = &ptr;
+ #if USE_BOOST
+ boost::shared_ptr<Base> sharedPtr(new Derived());
+ #else
+ int sharedPtr = 1;
+ #endif
+ BREAK_HERE
+ dummyStatement(&d, &s, &ptrToPtr, &sharedPtr, &ptrConst, &refConst, &ref);
+ }
+
+} // namespace gdb13393
+
+
namespace valgrind {
void testLeak()
@@ -4257,6 +4304,7 @@ int main(int argc, char *argv[])
bug5184::test5184();
bug5799::test5799();
bug6465::test6465();
+ gdb13393::test13393();
final::testFinal(&app);