[Libreoffice-commits] core.git: 2 commits - sc/qa sc/source

Markus Mohrhard markus.mohrhard at collabora.co.uk
Sun Jan 3 18:40:50 PST 2016


 sc/qa/unit/ucalc.hxx          |    2 +-
 sc/source/core/tool/token.cxx |   13 +++----------
 2 files changed, 4 insertions(+), 11 deletions(-)

New commits:
commit f4dc8a869ac49f19c20fc5fa606448e9103726bd
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sun Jan 3 16:29:50 2016 +0100

    the idea behind the test can't work right now
    
    The Test currently tries to test the OpenCL and the SW interpreter and
    assumes that it will show different results. However if we succeed in
    generating an OpenCL interpreter we will never generate a SW interpreter.
    
    There are a number of problems with the approach taken in this test.
    
    1.) Assuming that we are able to execute OpenCL is an invalid
    assumption.
    
    2.) Changing the configuration inside of a test needs to be exeption
    save as we are otherwise left with a strange config for the remaining
    test cases.
    
    3.) Changing the configuration does not change the formula group
    interpreter. This needs to be done explicitly.
    
    Change-Id: I679985ee7551b21aaa52038e107324980e7e1bb6

diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index fc90f81..b3e5bf3 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -474,7 +474,7 @@ public:
     CPPUNIT_TEST(testFormulaCreateStringFromTokens);
     CPPUNIT_TEST(testFormulaParseReference);
     CPPUNIT_TEST(testFetchVectorRefArray);
-    CPPUNIT_TEST(testFormulaHashAndTag);
+    // CPPUNIT_TEST(testFormulaHashAndTag);
     CPPUNIT_TEST(testFormulaTokenEquality);
     CPPUNIT_TEST(testFormulaRefData);
     CPPUNIT_TEST(testFormulaCompiler);
commit c4a90354df1009cd24a3ac4d1c72624759e7fe16
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sun Jan 3 16:18:46 2016 +0100

    let us use the standard way to implement an if .. else if
    
    Change-Id: Ie0b3efdbe23a163aab1e8d128217ee1f1c7fd287

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 05221e7..8e62a26 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1514,10 +1514,8 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
             default:
                 meVectorState = FormulaVectorDisabled;
         }
-        return;
     }
-
-    if (eOp == ocPush)
+    else if (eOp == ocPush)
     {
         // This is a stack variable.  See if this is a reference.
 
@@ -1557,28 +1555,23 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
             default:
                 ;
         }
-        return;
     }
-
-    if (eOp >= SC_OPCODE_START_BIN_OP &&
+    else if (eOp >= SC_OPCODE_START_BIN_OP &&
         eOp <= SC_OPCODE_STOP_UN_OP &&
         ScInterpreter::GetGlobalConfig().mbOpenCLSubsetOnly &&
         ScInterpreter::GetGlobalConfig().mpOpenCLSubsetOpCodes->find(eOp) == ScInterpreter::GetGlobalConfig().mpOpenCLSubsetOpCodes->end())
     {
         meVectorState = FormulaVectorDisabled;
-        return;
     }
-
     // only when openCL interpreter is not enabled - the assumption is that
     // the S/W interpreter blacklist is more strict
-    if (eOp >= SC_OPCODE_START_BIN_OP &&
+    else if (eOp >= SC_OPCODE_START_BIN_OP &&
         eOp <= SC_OPCODE_STOP_UN_OP &&
         ScCalcConfig::isSwInterpreterEnabled() &&
         (dynamic_cast<sc::FormulaGroupInterpreterSoftware*>(sc::FormulaGroupInterpreter::getStatic()) != nullptr) &&
         ScInterpreter::GetGlobalConfig().mpSwInterpreterSubsetOpCodes->find(eOp) == ScInterpreter::GetGlobalConfig().mpSwInterpreterSubsetOpCodes->end())
     {
         meVectorState = FormulaVectorDisabled;
-        return;
     }
 }
 


More information about the Libreoffice-commits mailing list