summaryrefslogtreecommitdiff
path: root/tools/qa/cppunit
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-08 21:36:18 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-09 13:15:39 +0200
commitd8e90fdd90f299445509d93c905446f879bf8c73 (patch)
treec69e4d52d960f5366c9f9aa9d24e66f7c7c8e5f6 /tools/qa/cppunit
parent987e99d9e38479211fad6bc97134c75bebcf615b (diff)
there are 3600000 seconds in an hour
regression from... commit 9830fd36dbdb72c79703b0c61efc027fba793c5a Date: Sun Mar 17 08:36:26 2013 +0100 date/time IDL datatypes incompatible change Change-Id: I2f4b64a73b5529ba190acc678d907761bb568bbf Reviewed-on: https://gerrit.libreoffice.org/54009 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'tools/qa/cppunit')
-rw-r--r--tools/qa/cppunit/test_time.cxx41
1 files changed, 41 insertions, 0 deletions
diff --git a/tools/qa/cppunit/test_time.cxx b/tools/qa/cppunit/test_time.cxx
new file mode 100644
index 000000000000..f1915b71baa1
--- /dev/null
+++ b/tools/qa/cppunit/test_time.cxx
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+#include <tools/time.hxx>
+
+namespace tools
+{
+class TimeTest : public CppUnit::TestFixture
+{
+public:
+ void testTime();
+
+ CPPUNIT_TEST_SUITE(TimeTest);
+ CPPUNIT_TEST(testTime);
+ CPPUNIT_TEST_SUITE_END();
+};
+
+void TimeTest::testTime()
+{
+ Time aOrigTime(1, 56, 10);
+ auto nMS = aOrigTime.GetMSFromTime();
+
+ Time aNewTime(0);
+ aNewTime.MakeTimeFromMS(nMS);
+
+ CPPUNIT_ASSERT(bool(aOrigTime == aNewTime));
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(TimeTest);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */