[Libreoffice-commits] core.git: tools/qa

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Wed Sep 2 16:51:28 PDT 2015


 tools/qa/cppunit/test_color.cxx |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit eb2e1ab4651350bffc53f618961a910bd3bbcfd9
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Thu Sep 3 08:48:04 2015 +0900

    Report reference color and expected color if test fails
    
    Change-Id: I7c8110b31171b247bcd46cee02f41972f59cbdcc

diff --git a/tools/qa/cppunit/test_color.cxx b/tools/qa/cppunit/test_color.cxx
index 8639ebe..a1847df 100644
--- a/tools/qa/cppunit/test_color.cxx
+++ b/tools/qa/cppunit/test_color.cxx
@@ -82,9 +82,20 @@ bool checkTintShade(sal_uInt8 nR, sal_uInt8 nG, sal_uInt8 nB, OUString const & s
 {
     Color aColor(nR, nG, nB);
     if (sReference != aColor.AsRGBHexString())
+    {
+        fprintf(stderr, "FAILED: Input and reference color mismatch %s\n",
+                sReference.toUtf8().getStr());
         return false;
+    }
     aColor.ApplyTintOrShade(nTintShade);
-    return sExpected == aColor.AsRGBHexString();
+    if (sExpected != aColor.AsRGBHexString())
+    {
+        fprintf(stderr, "FAILED: Reference color is %s which differs from expect %s\n",
+                sReference.toUtf8().getStr(),
+                sExpected.toUtf8().getStr());
+        return false;
+    }
+    return true;
 }
 
 void Test::test_ApplyTintOrShade()


More information about the Libreoffice-commits mailing list