summaryrefslogtreecommitdiff
path: root/sc/qa/unit/functions_test.cxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2024-05-27 17:04:33 +0200
committerEike Rathke <erack@redhat.com>2024-05-27 23:52:46 +0200
commitea1221867af90b452ec2d96b6b141abd6b8408cd (patch)
treebaeac669dd303db0ad4a84c3aca12f76999e97c5 /sc/qa/unit/functions_test.cxx
parent75776e7fb94affecb60ae5b9816d72ecafa3e340 (diff)
FunctionsTest: get detailed error also for string results
That always was "result: 0, expected: 0" because it created a number from string. Also, while it looped over all sheets starting with the second, values were always obtained from the second sheet. Change-Id: Ib2d2a51d757c12fd9cd2a76b0b194c2112747e62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168107 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'sc/qa/unit/functions_test.cxx')
-rw-r--r--sc/qa/unit/functions_test.cxx28
1 files changed, 21 insertions, 7 deletions
diff --git a/sc/qa/unit/functions_test.cxx b/sc/qa/unit/functions_test.cxx
index 40504480d04d..862711e16cb7 100644
--- a/sc/qa/unit/functions_test.cxx
+++ b/sc/qa/unit/functions_test.cxx
@@ -45,13 +45,27 @@ bool FunctionsTest::load(const OUString& rFilter, const OUString& rURL,
// the formula text.
if(rDoc.HasStringData(2, row, tab) || !rDoc.HasData(2, row, tab))
continue;
- if(!rtl::math::approxEqual(1.0, rDoc.GetValue(2, row, 1)))
- CPPUNIT_FAIL( OUString( "Testing " + rURL + " failed, "
- + rDoc.GetAllTableNames()[tab] + ".A" + OUString::number(row+1)
- + " \'" + rDoc.GetString(3, row, 1) + "\'"
- " result: " + OUString::number(rDoc.GetValue(0, row, 1))
- + ", expected: " + OUString::number(rDoc.GetValue(1, row, 1)))
- .toUtf8().getStr());
+ if (!rtl::math::approxEqual(1.0, rDoc.GetValue(2, row, tab)))
+ {
+ if (rDoc.HasValueData(1, row, tab))
+ {
+ CPPUNIT_FAIL( OUString( "Testing " + rURL + " failed, "
+ + rDoc.GetAllTableNames()[tab] + ".A" + OUString::number(row+1)
+ + " \'" + rDoc.GetString(3, row, tab) + "\'"
+ " result: " + OUString::number(rDoc.GetValue(0, row, tab))
+ + ", expected: " + OUString::number(rDoc.GetValue(1, row, tab)))
+ .toUtf8().getStr());
+ }
+ else
+ {
+ CPPUNIT_FAIL( OUString( "Testing " + rURL + " failed, "
+ + rDoc.GetAllTableNames()[tab] + ".A" + OUString::number(row+1)
+ + " \'" + rDoc.GetString(3, row, tab) + "\'"
+ " result: " + rDoc.GetString(0, row, tab)
+ + ", expected: " + rDoc.GetString(1, row, tab))
+ .toUtf8().getStr());
+ }
+ }
}
}
}