summaryrefslogtreecommitdiff
path: root/sax/qa
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-12-17 16:45:39 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-12-17 16:56:35 +0100
commit0b2bc82f3cef534d8cab60d8c48a4113abce38cd (patch)
treede5c53e8f8f50c5e68ee7b810973c6080745ed8d /sax/qa
parent0d1e734739cb4e8deaf0dc5d412fbe8d6745e1b1 (diff)
Improve CPPUNIT_ASSERTs
Change-Id: I971602ce562ae0e11be5ac7b4d1eefbd342b625c
Diffstat (limited to 'sax/qa')
-rw-r--r--sax/qa/cppunit/test_converter.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/sax/qa/cppunit/test_converter.cxx b/sax/qa/cppunit/test_converter.cxx
index 7145e5e6b05c..cbc3ae0b84b5 100644
--- a/sax/qa/cppunit/test_converter.cxx
+++ b/sax/qa/cppunit/test_converter.cxx
@@ -86,14 +86,6 @@ void ConverterTest::tearDown()
{
}
-static bool eqDuration(util::Duration a, util::Duration b) {
- return a.Years == b.Years && a.Months == b.Months && a.Days == b.Days
- && a.Hours == b.Hours && a.Minutes == b.Minutes
- && a.Seconds == b.Seconds
- && a.NanoSeconds == b.NanoSeconds
- && a.Negative == b.Negative;
-}
-
static void doTest(util::Duration const & rid, char const*const pis,
char const*const i_pos = 0)
{
@@ -104,7 +96,14 @@ static void doTest(util::Duration const & rid, char const*const pis,
bool bSuccess = Converter::convertDuration(od, is);
SAL_INFO("sax.cppunit","" << (od.Negative ? "-" : "+") << " " << od.Years << "Y " << od.Months << "M " << od.Days << "D " << od.Hours << "H " << od.Minutes << "M " << od.Seconds << "S " << od.NanoSeconds << "n");
CPPUNIT_ASSERT(bSuccess);
- CPPUNIT_ASSERT(eqDuration(rid, od));
+ CPPUNIT_ASSERT_EQUAL(rid.Years, od.Years);
+ CPPUNIT_ASSERT_EQUAL(rid.Months, od.Months);
+ CPPUNIT_ASSERT_EQUAL(rid.Days, od.Days);
+ CPPUNIT_ASSERT_EQUAL(rid.Hours, od.Hours);
+ CPPUNIT_ASSERT_EQUAL(rid.Minutes, od.Minutes);
+ CPPUNIT_ASSERT_EQUAL(rid.Seconds, od.Seconds);
+ CPPUNIT_ASSERT_EQUAL(rid.NanoSeconds, od.NanoSeconds);
+ CPPUNIT_ASSERT_EQUAL(rid.Negative, od.Negative);
OUStringBuffer buf;
Converter::convertDuration(buf, od);
SAL_INFO("sax.cppunit","" << buf.toString());