summaryrefslogtreecommitdiff
path: root/vcl/backendtest
diff options
context:
space:
mode:
authorGabor Kelemen <kelemeng@ubuntu.com>2022-01-06 12:38:13 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2022-01-11 09:22:52 +0100
commitcf3840931454553ff25e488dc1ede2af65e0016b (patch)
treeba03aba6df6f0b6895e7f5502e9f3e123755886d /vcl/backendtest
parent98538ea2155274b4cdb66a5d4e46d221aec564d3 (diff)
tdf#145919 Localize strings in Graphics Test dialog
but not in the saved log file Change-Id: I65c580e7b8762b654f1812c96bc53841b882a960 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128087 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'vcl/backendtest')
-rw-r--r--vcl/backendtest/GraphicsRenderTests.cxx56
1 files changed, 49 insertions, 7 deletions
diff --git a/vcl/backendtest/GraphicsRenderTests.cxx b/vcl/backendtest/GraphicsRenderTests.cxx
index 554d73f43553..efa3c281fb4f 100644
--- a/vcl/backendtest/GraphicsRenderTests.cxx
+++ b/vcl/backendtest/GraphicsRenderTests.cxx
@@ -9,6 +9,8 @@
*/
#include <test/outputdevice.hxx>
+#include <svl/svlresid.hxx>
+#include <svl/svl.hrc>
#include <unotools/bootstrap.hxx>
#include <vcl/test/GraphicsRenderTests.hxx>
#include <vcl/graphicfilter.hxx>
@@ -16,6 +18,7 @@
#include <svdata.hxx>
#include <salinst.hxx>
+#include <strings.hrc>
#include <unordered_map>
@@ -27,6 +30,31 @@
&& aOutDevTest.getRenderBackendName() != "genpsp" \
&& aOutDevTest.getRenderBackendName() != "win")
+OUString VclTestResult::getStatus(bool bLocalize)
+{ // tdf#145919 localize for UI but not in the log file
+ if (bLocalize)
+ {
+ if (m_aTestStatus == "PASSED")
+ {
+ return SvlResId(GRTSTR_PASSED);
+ }
+ else if (m_aTestStatus == "QUIRKY")
+ {
+ return SvlResId(GRTSTR_QUIRKY);
+ }
+ else if (m_aTestStatus == "FAILED")
+ {
+ return SvlResId(GRTSTR_FAILED);
+ }
+ else
+ {
+ return SvlResId(GRTSTR_SKIPPED);
+ }
+ }
+ else
+ return m_aTestStatus;
+}
+
namespace
{
void exportBitmapExToImage(OUString const& rImageName, const BitmapEx& rBitmapEx)
@@ -2336,10 +2364,10 @@ void GraphicsRenderTests::appendTestResult(OUString aTestName, OUString aTestSta
std::vector<VclTestResult>& GraphicsRenderTests::getTestResults() { return m_aTestResult; }
-OUString GraphicsRenderTests::getResultString()
+OUString GraphicsRenderTests::getResultString(bool bLocalize)
{
std::vector<int> testResults(4);
- for (const VclTestResult& test : m_aTestResult)
+ for (VclTestResult& test : m_aTestResult)
{
if (test.getStatus() == "PASSED")
{
@@ -2358,11 +2386,25 @@ OUString GraphicsRenderTests::getResultString()
testResults[3]++;
}
}
- OUString resultString = "Graphics Backend used: " + m_aCurGraphicsBackend
- + "\nPassed Tests : " + OUString::number(testResults[0])
- + "\nQuirky Tests : " + OUString::number(testResults[1])
- + "\nFailed Tests : " + OUString::number(testResults[2])
- + "\nSkipped Tests : " + OUString::number(testResults[3]) + "\n";
+ // tdf#145919 localize for UI but not in the log file
+ OUString resultString;
+ if (bLocalize)
+ {
+ resultString
+ = VclResId(STR_GBU).replaceFirst("%1", m_aCurGraphicsBackend) + "\n"
+ + VclResId(STR_PASSED).replaceFirst("%1", OUString::number(testResults[0])) + "\n"
+ + VclResId(STR_QUIRKY).replaceFirst("%1", OUString::number(testResults[1])) + "\n"
+ + VclResId(STR_FAILED).replaceFirst("%1", OUString::number(testResults[2])) + "\n"
+ + VclResId(STR_SKIPPED).replaceFirst("%1", OUString::number(testResults[3])) + "\n";
+ }
+ else
+ {
+ resultString = "Graphics Backend used: " + m_aCurGraphicsBackend
+ + "\nPassed Tests: " + OUString::number(testResults[0])
+ + "\nQuirky Tests: " + OUString::number(testResults[1])
+ + "\nFailed Tests: " + OUString::number(testResults[2])
+ + "\nSkipped Tests: " + OUString::number(testResults[3]) + "\n";
+ }
return resultString;
}