Kaydet (Commit) 36b658d3 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

generate better unit test assert message

Change-Id: Ibba7f18fefb4f2851472a6ae0b41447237a6b97f
Reviewed-on: https://gerrit.libreoffice.org/20270Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 9e653980
......@@ -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);
......
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