Commit c828c363 authored by hjk's avatar hjk Committed by hjk

debugger: new dumpers for boost::posix_time::{ptime,time_duration}

Task-number: QTCREATORBUG-6834
Change-Id: I494868dd4e8819284dbc7439cff89ffe07f6a958
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent b46cdd37
......@@ -2057,6 +2057,17 @@ def qdump__boost__gregorian__date(d, value):
d.putNumChild(0)
def qdump__boost__posix_time__ptime(d, item):
ms = long(item["time_"]["time_count_"]["value_"]) / 1000
d.putValue("%s/%s" % divmod(ms, 86400000), JulianDateAndMillisecondsSinceMidnight)
d.putNumChild(0)
def qdump__boost__posix_time__time_duration(d, item):
d.putValue(long(item["ticks_"]["value_"]) / 1000, MillisecondsSinceMidnight)
d.putNumChild(0)
#######################################################################
#
# Symbian
......
......@@ -178,7 +178,9 @@ void dummyStatement(...) {}
#if USE_BOOST
#include <boost/optional.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/date_time.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#endif
#if USE_EIGEN
......@@ -5003,11 +5005,52 @@ namespace boost {
dummyStatement(&d);
}
void testBoostPosixTimeTimeDuration()
{
using namespace boost;
using namespace posix_time;
time_duration d1(1, 0, 0);
BREAK_HERE;
// Check p1 01:00:00 boost::posix_time::time_duration.
// Continue.
time_duration d2(0, 1, 0);
BREAK_HERE;
// Check d1 00:00:01 boost::posix_time::time_duration.
// Continue.
time_duration d3(0, 0, 1);
BREAK_HERE;
// Check d1 00:00:01 boost::posix_time::time_duration.
// Continue.
dummyStatement(&d1, &d2, &d3);
}
void testBoostPosixTimePtime()
{
using namespace boost;
using namespace gregorian;
using namespace posix_time;
ptime p1(date(2002, 1, 10), time_duration(1, 0, 0));
BREAK_HERE;
// Check p1 Thu Jan 10 01:00:00 2002 boost::posix_time::ptime.
// Continue.
ptime p2(date(2002, 1, 10), time_duration(0, 0, 0));
BREAK_HERE;
// Check p1 Thu Jan 10 00:00:00 2002 boost::posix_time::ptime.
// Continue.
ptime p3(date(1970, 1, 1), time_duration(0, 0, 0));
BREAK_HERE;
// Check p1 Thu Jan 1 00:00:00 1970 boost::posix_time::ptime.
// Continue.
dummyStatement(&p1, &p2, &p3);
}
void testBoost()
{
testBoostOptional1();
testBoostOptional2();
testBoostSharedPtr();
testBoostPosixTimeTimeDuration();
testBoostPosixTimePtime();
testBoostGregorianDate();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment