[Libreoffice-commits] core.git: 4 commits - qadevOOo/runner qadevOOo/tests

Caolán McNamara caolanm at redhat.com
Thu Nov 5 03:08:02 PST 2015


 qadevOOo/runner/helper/APIDescGetter.java               |    2 
 qadevOOo/tests/java/ifc/awt/_XCurrencyField.java        |   39 +++++++++-------
 qadevOOo/tests/java/ifc/awt/_XNumericField.java         |   32 +++++++------
 qadevOOo/tests/java/ifc/chart/_XChartDataArray.java     |    4 +
 qadevOOo/tests/java/ifc/style/_CharacterProperties.java |    1 
 5 files changed, 45 insertions(+), 33 deletions(-)

New commits:
commit 75da22e3ce80f8dcdeef0488b22c4dc522c2ec29
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 5 09:45:18 2015 +0000

    coverity#1326925 silence Suspicious use of non-short-circuit boolean operator
    
    Change-Id: I4d71640baa3c169fba069ca1328273fb78964541

diff --git a/qadevOOo/tests/java/ifc/chart/_XChartDataArray.java b/qadevOOo/tests/java/ifc/chart/_XChartDataArray.java
index 14ead16..cd84569 100644
--- a/qadevOOo/tests/java/ifc/chart/_XChartDataArray.java
+++ b/qadevOOo/tests/java/ifc/chart/_XChartDataArray.java
@@ -218,7 +218,9 @@ public class _XChartDataArray extends MultiMethodTest {
             bResult = false;
         for (int i = 0; i < data.length; i++) {
             for (int j = 0; j < data[i].length; j++) {
-                bResult &= data[i][j] == _data[i][j];
+                if (data[i][j] != _data[i][j]) {
+                    bResult = false;
+                }
             }
         }
 
commit c5cb780bda98ed6979268b0e436d977c4db01216
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 5 09:40:27 2015 +0000

    coverity#1326578 Useless call
    
    Change-Id: Ib6f7463d97e9c835b2c9d64fa498efd546360645

diff --git a/qadevOOo/tests/java/ifc/style/_CharacterProperties.java b/qadevOOo/tests/java/ifc/style/_CharacterProperties.java
index c1c651c..db07327 100644
--- a/qadevOOo/tests/java/ifc/style/_CharacterProperties.java
+++ b/qadevOOo/tests/java/ifc/style/_CharacterProperties.java
@@ -256,7 +256,6 @@ public class _CharacterProperties extends MultiPropertyTest {
             changeProp((XPropertySet) oPara,
                 (XPropertySet) oPort,"RubyAdjust", aShort);
         }
-        Short.valueOf((short) 1);
     }
 
     /**
commit f1fbda5bf7cecd7f1b5605137b0a60c22f600e37
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 5 09:39:02 2015 +0000

    coverity#1326577 Useless call
    
    Change-Id: I3f9742cafdcdce3302c925a2227da1f7839c80c3

diff --git a/qadevOOo/runner/helper/APIDescGetter.java b/qadevOOo/runner/helper/APIDescGetter.java
index 55a2698..19fdaac 100644
--- a/qadevOOo/runner/helper/APIDescGetter.java
+++ b/qadevOOo/runner/helper/APIDescGetter.java
@@ -298,7 +298,7 @@ public class APIDescGetter extends DescGetter
                 }
                 if (aToken.hasMoreTokens())
                 {
-                    StringHelper.removeQuoteIfExists(aToken.nextToken());
+                    aToken.nextToken();
                 }
                 if (aToken.hasMoreTokens())
                 {
commit addec679db06203eb4cea71d8f98d38fec9f772c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 5 09:22:51 2015 +0000

    coverity#1326879 FE: Test for floating point equality
    
    and
    
    coverity#1326880 FE: Test for floating point equality
    coverity#1326881 FE: Test for floating point equality
    coverity#1326882 FE: Test for floating point equality
    coverity#1326883 FE: Test for floating point equality
    coverity#1326884 FE: Test for floating point equality
    coverity#1326885 FE: Test for floating point equality
    coverity#1326886 FE: Test for floating point equality
    coverity#1326887 FE: Test for floating point equality
    coverity#1326888 FE: Test for floating point equality
    
    Change-Id: I04a00035d541ea7a253a37d2a87c4dc407228346

diff --git a/qadevOOo/tests/java/ifc/awt/_XCurrencyField.java b/qadevOOo/tests/java/ifc/awt/_XCurrencyField.java
index 3b03b86..beb7488 100644
--- a/qadevOOo/tests/java/ifc/awt/_XCurrencyField.java
+++ b/qadevOOo/tests/java/ifc/awt/_XCurrencyField.java
@@ -21,6 +21,7 @@ package ifc.awt;
 import lib.MultiMethodTest;
 
 import com.sun.star.awt.XCurrencyField;
+import util.utils;
 
 /**
 * Testing <code>com.sun.star.awt.XCurrencyField</code>
@@ -69,9 +70,12 @@ public class _XCurrencyField extends MultiMethodTest {
     public void _setValue() {
         requiredMethod("getValue()");
 
-        oObj.setValue(val + 1.1);
+        double value = val + 1.1;
+        oObj.setValue(value);
+        double ret = oObj.getValue();
+        boolean result = utils.approxEqual(ret, value);
 
-        tRes.tested("setValue()", oObj.getValue() == val + 1.1);
+        tRes.tested("setValue()", result);
     }
 
     /**
@@ -95,9 +99,12 @@ public class _XCurrencyField extends MultiMethodTest {
     public void _setMin() {
         requiredMethod("getMin()");
 
-        oObj.setMin(min + 1.1);
+        double value = min + 1.1;
+        oObj.setMin(value);
+        double ret = oObj.getMin();
+        boolean result = utils.approxEqual(ret, value);
 
-        tRes.tested("setMin()", oObj.getMin() == min + 1.1);
+        tRes.tested("setMin()", result);
     }
 
     /**
@@ -123,9 +130,10 @@ public class _XCurrencyField extends MultiMethodTest {
     public void _setMax() {
         requiredMethod("getMax()");
 
-        boolean result = true;
-        oObj.setMax(max + 1.1);
-        result = oObj.getMax() == max + 1.1;
+        double value = max + 1.1;
+        oObj.setMax(value);
+        double ret = oObj.getMax();
+        boolean result = utils.approxEqual(ret, value);
 
         tRes.tested("setMax()", result);
     }
@@ -153,11 +161,10 @@ public class _XCurrencyField extends MultiMethodTest {
     public void _setFirst() {
         requiredMethod("getFirst()");
 
-        boolean result = true;
         double value = first + 1.1;
         oObj.setFirst(value);
         double ret = oObj.getFirst();
-        result = ret == value;
+        boolean result = utils.approxEqual(ret, value);
 
         tRes.tested("setFirst()", result);
     }
@@ -185,11 +192,10 @@ public class _XCurrencyField extends MultiMethodTest {
     public void _setLast() {
         requiredMethod("getLast()");
 
-        boolean result = true;
-        oObj.setLast(last + 1.1);
+        double value = last + 1.1;
+        oObj.setLast(value);
         double ret = oObj.getLast();
-
-        result = ret == last + 1.1;
+        boolean result = utils.approxEqual(ret, value);
 
         tRes.tested("setLast()", result);
     }
@@ -217,9 +223,10 @@ public class _XCurrencyField extends MultiMethodTest {
     public void _setSpinSize() {
         requiredMethod("getSpinSize()");
 
-        boolean result = true;
-        oObj.setSpinSize(spin + 1.1);
-        result = oObj.getSpinSize() == spin + 1.1;
+        double value = spin + 1.1;
+        oObj.setSpinSize(value);
+        double ret = oObj.getSpinSize();
+        boolean result = utils.approxEqual(ret, value);
 
         tRes.tested("setSpinSize()", result);
     }
diff --git a/qadevOOo/tests/java/ifc/awt/_XNumericField.java b/qadevOOo/tests/java/ifc/awt/_XNumericField.java
index 3337f18..54c25fa 100644
--- a/qadevOOo/tests/java/ifc/awt/_XNumericField.java
+++ b/qadevOOo/tests/java/ifc/awt/_XNumericField.java
@@ -22,6 +22,7 @@ package ifc.awt;
 import lib.MultiMethodTest;
 
 import com.sun.star.awt.XNumericField;
+import util.utils;
 
 /**
 * Testing <code>com.sun.star.awt.XNumericField</code>
@@ -96,9 +97,12 @@ public class _XNumericField extends MultiMethodTest {
     public void _setMin() {
         requiredMethod("getMin()") ;
 
-        oObj.setMin(min + 1.1) ;
+        double value = min + 1.1;
+        oObj.setMin(value);
+        double ret = oObj.getMin();
+        boolean result = utils.approxEqual(ret, value);
 
-        tRes.tested("setMin()", oObj.getMin() == min + 1.1) ;
+        tRes.tested("setMin()", result);
     }
 
     /**
@@ -124,9 +128,10 @@ public class _XNumericField extends MultiMethodTest {
     public void _setMax() {
         requiredMethod("getMax()") ;
 
-        boolean result = true ;
-        oObj.setMax(max + 1.1) ;
-        result = oObj.getMax() == max + 1.1 ;
+        double value = max + 1.1;
+        oObj.setMax(value);
+        double ret = oObj.getMax();
+        boolean result = utils.approxEqual(ret, value);
 
         tRes.tested("setMax()", result) ;
     }
@@ -154,10 +159,10 @@ public class _XNumericField extends MultiMethodTest {
     public void _setFirst() {
         requiredMethod("getFirst()") ;
 
-        boolean result = true ;
-        oObj.setFirst(first + 1.1) ;
-        double ret = oObj.getFirst() ;
-        result = ret == first + 1.1 ;
+        double value = first + 1.1;
+        oObj.setFirst(value);
+        double ret = oObj.getFirst();
+        boolean result = utils.approxEqual(ret, value);
 
         tRes.tested("setFirst()", result) ;
     }
@@ -185,11 +190,10 @@ public class _XNumericField extends MultiMethodTest {
     public void _setLast() {
         requiredMethod("getLast()") ;
 
-        boolean result = true ;
-        oObj.setLast(last + 1.1) ;
-        double ret = oObj.getLast() ;
-
-        result = ret == last + 1.1 ;
+        double value = last + 1.1;
+        oObj.setLast(value);
+        double ret = oObj.getLast();
+        boolean result = utils.approxEqual(ret, value);
 
         tRes.tested("setLast()", result) ;
     }


More information about the Libreoffice-commits mailing list