From 7c9dcec74761b5627382346fd6834636fc217b97 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 4 Mar 2011 17:22:58 +0100 Subject: [PATCH] debugger: add manual test for boost::optional --- .../gdbdebugger/simple/simple_gdbtest_app.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/manual/gdbdebugger/simple/simple_gdbtest_app.cpp b/tests/manual/gdbdebugger/simple/simple_gdbtest_app.cpp index 6e3f20957fd..9fa776d6168 100644 --- a/tests/manual/gdbdebugger/simple/simple_gdbtest_app.cpp +++ b/tests/manual/gdbdebugger/simple/simple_gdbtest_app.cpp @@ -87,6 +87,7 @@ #define USE_BOOST 1 #if USE_BOOST +#include #include #endif @@ -2360,11 +2361,26 @@ void testQScriptValue(int argc, char *argv[]) s = engine.newDate(date); x = s.toInt32(); bool xx = s.isDate(); + Q_UNUSED(xx); date = s.toDateTime(); s.setProperty("a", QScriptValue()); QScriptValue d = s.data(); } +void testBoostOptional() +{ +#if USE_BOOST + boost::optional i; + i = 1; + boost::optional sl; + sl = (QStringList() << "xxx" << "yyy"); + sl.get().append("zzz"); + i = 3; + i = 4; + i = 5; +#endif +} + void testBoostSharedPtr() { #if USE_BOOST @@ -2375,6 +2391,7 @@ void testBoostSharedPtr() boost::shared_ptr s; boost::shared_ptr i(new int(43)); boost::shared_ptr j = i; + boost::shared_ptr sl(new QStringList); int k = 2; ++k; #endif @@ -2473,6 +2490,7 @@ int main(int argc, char *argv[]) testQVector(); testQVectorOfQList(); + testBoostOptional(); testBoostSharedPtr(); //*(int *)0 = 0;