diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-11-29 15:33:52 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-11-29 20:22:45 +0000 |
commit | 36b658d38930b8aca7e16f7a6b286ca1b3e7a215 (patch) | |
tree | 6460564a4591df1b84cd2fced03e0c6b200cde60 | |
parent | 9e6539808da750e9da9b68258cd41fb2f42662aa (diff) |
generate better unit test assert message
Change-Id: Ibba7f18fefb4f2851472a6ae0b41447237a6b97f
Reviewed-on: https://gerrit.libreoffice.org/20270
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | basic/qa/cppunit/test_scanner.cxx | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/basic/qa/cppunit/test_scanner.cxx b/basic/qa/cppunit/test_scanner.cxx index 2927e6ea7025..ec5836e85850 100644 --- a/basic/qa/cppunit/test_scanner.cxx +++ b/basic/qa/cppunit/test_scanner.cxx @@ -67,12 +67,12 @@ namespace CPPUNIT_TEST_SUITE_END(); }; - static const char cr[] = "\n"; - static const char rem[] = "REM"; - static const char asdf[] = "asdf"; - static const char dot[] = "."; - static const char goto_[] = "goto"; - static const char excl[] = "!"; + static const OUString cr = "\n"; + static const OUString rem = "REM"; + static const OUString asdf = "asdf"; + static const OUString dot = "."; + static const OUString goto_ = "goto"; + static const OUString excl = "!"; std::vector<Symbol> getSymbols(const OUString& source, sal_Int32& errors, bool bCompatible = false) { @@ -118,14 +118,14 @@ namespace CPPUNIT_ASSERT(symbols.empty()); symbols = getSymbols(source2); - CPPUNIT_ASSERT(symbols.size() == 1); - CPPUNIT_ASSERT(symbols[0].text == cr); - CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT); + CPPUNIT_ASSERT_EQUAL(symbols.size(), size_t(1)); + CPPUNIT_ASSERT_EQUAL(symbols[0].text, cr); + CPPUNIT_ASSERT_EQUAL(symbols[0].type, SbxVARIANT); symbols = getSymbols(source3); - CPPUNIT_ASSERT(symbols.size() == 1); - CPPUNIT_ASSERT(symbols[0].text == cr); - CPPUNIT_ASSERT(symbols[0].type == SbxVARIANT); + CPPUNIT_ASSERT_EQUAL(symbols.size(), size_t(1)); + CPPUNIT_ASSERT_EQUAL(symbols[0].text, cr); + CPPUNIT_ASSERT_EQUAL(symbols[0].type, SbxVARIANT); symbols = getSymbols(source4); CPPUNIT_ASSERT(symbols.size() == 1); @@ -579,7 +579,7 @@ namespace CPPUNIT_ASSERT(symbols.size() == 3); CPPUNIT_ASSERT(symbols[0].number == 1.2); CPPUNIT_ASSERT(symbols[0].type == SbxDOUBLE); - CPPUNIT_ASSERT(rtl::math::round( symbols[1].number, 12) == rtl::math::round( .3, 12)); + CPPUNIT_ASSERT_EQUAL(rtl::math::round( .3, 12), rtl::math::round( symbols[1].number, 12)); CPPUNIT_ASSERT(symbols[1].type == SbxDOUBLE); CPPUNIT_ASSERT(symbols[2].text == cr); CPPUNIT_ASSERT(errors == 1); |