summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2013-10-02 08:45:13 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2013-10-02 08:59:04 (GMT)
commitdfa3f1bedb4927fa7b9bd5a97497ec7b6ca2a868 (patch)
tree718cf0b2ebb38c1e982601494726596b8efee5d1
parent12bbe54305986dcd80d6ce037879d368b8052354 (diff)
downloadlibkolab-dfa3f1bedb4927fa7b9bd5a97497ec7b6ca2a868.tar.gz
Duration serializer for debugging.
-rw-r--r--tests/testhelpers.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/testhelpers.h b/tests/testhelpers.h
index 546bc30..f0e3889 100644
--- a/tests/testhelpers.h
+++ b/tests/testhelpers.h
@@ -312,6 +312,21 @@ namespace QTest {
return qstrdup(ba.data());
}
+ template<>
+ char *toString(const Kolab::Duration &p)
+ {
+ QByteArray ba = "Kolab::Duration";
+ ba += p.isNegative() ? "-": "+";
+ ba += "(";
+ ba += QString::number(p.weeks())+ ", ";
+ ba += QString::number(p.days())+ ", ";
+ ba += QString::number(p.hours())+ ", ";
+ ba += QString::number(p.minutes())+ ", ";
+ ba += QString::number(p.seconds());
+ ba += ")";
+ return qstrdup(ba.data());
+ }
+
}
#endif