debugger: add manual test for boost::optional

This commit is contained in:
hjk
2011-03-04 17:22:58 +01:00
parent 42a7fd55fe
commit 7c9dcec747

View File

@@ -87,6 +87,7 @@
#define USE_BOOST 1 #define USE_BOOST 1
#if USE_BOOST #if USE_BOOST
#include <boost/optional.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#endif #endif
@@ -2360,11 +2361,26 @@ void testQScriptValue(int argc, char *argv[])
s = engine.newDate(date); s = engine.newDate(date);
x = s.toInt32(); x = s.toInt32();
bool xx = s.isDate(); bool xx = s.isDate();
Q_UNUSED(xx);
date = s.toDateTime(); date = s.toDateTime();
s.setProperty("a", QScriptValue()); s.setProperty("a", QScriptValue());
QScriptValue d = s.data(); QScriptValue d = s.data();
} }
void testBoostOptional()
{
#if USE_BOOST
boost::optional<int> i;
i = 1;
boost::optional<QStringList> sl;
sl = (QStringList() << "xxx" << "yyy");
sl.get().append("zzz");
i = 3;
i = 4;
i = 5;
#endif
}
void testBoostSharedPtr() void testBoostSharedPtr()
{ {
#if USE_BOOST #if USE_BOOST
@@ -2375,6 +2391,7 @@ void testBoostSharedPtr()
boost::shared_ptr<int> s; boost::shared_ptr<int> s;
boost::shared_ptr<int> i(new int(43)); boost::shared_ptr<int> i(new int(43));
boost::shared_ptr<int> j = i; boost::shared_ptr<int> j = i;
boost::shared_ptr<QStringList> sl(new QStringList);
int k = 2; int k = 2;
++k; ++k;
#endif #endif
@@ -2473,6 +2490,7 @@ int main(int argc, char *argv[])
testQVector(); testQVector();
testQVectorOfQList(); testQVectorOfQList();
testBoostOptional();
testBoostSharedPtr(); testBoostSharedPtr();
//*(int *)0 = 0; //*(int *)0 = 0;