diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx index 10ede9876731..da1286bb8cb1 100644 --- a/sc/qa/unit/helper/qahelper.cxx +++ b/sc/qa/unit/helper/qahelper.cxx @@ -7,6 +7,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include + #include "qahelper.hxx" #include #include @@ -687,6 +689,8 @@ void ScModelTestBase::miscRowHeightsTest( TestParam const * aTestValues, unsigne } } +#if HAVE_FEATURE_OPENCL + void ScModelTestBase::enableOpenCL() { /** @@ -701,7 +705,9 @@ void ScModelTestBase::disableOpenCL() sc::FormulaGroupInterpreter::disableOpenCL_UnitTestsOnly(); } -void ScModelTestBase::initTestEnv(std::u16string_view fileName) +#endif + +void ScModelTestBase::initTestEnv([[maybe_unused]] std::u16string_view fileName) { // Some documents contain macros, disable them, otherwise // the "Error, BASIC runtime error." dialog is prompted @@ -714,6 +720,7 @@ void ScModelTestBase::initTestEnv(std::u16string_view fileName) aMacroValue.State = beans::PropertyState_DIRECT_VALUE; args.push_back(aMacroValue); +#if HAVE_FEATURE_OPENCL disableOpenCL(); CPPUNIT_ASSERT(!ScCalcConfig::isOpenCLEnabled()); @@ -734,6 +741,7 @@ void ScModelTestBase::initTestEnv(std::u16string_view fileName) // Check there are 2 documents uno::Reference xFrames = mxDesktop->getFrames(); CPPUNIT_ASSERT_EQUAL(static_cast(2), xFrames->getCount()); +#endif // HAVE_FEATURE_OPENCL } ScRange ScUcalcTestBase::insertRangeData( diff --git a/sc/qa/unit/parallelism.cxx b/sc/qa/unit/parallelism.cxx index 205f8bca32a8..903c97be4fd2 100644 --- a/sc/qa/unit/parallelism.cxx +++ b/sc/qa/unit/parallelism.cxx @@ -8,6 +8,7 @@ */ #include +#include #include "helper/qahelper.hxx" @@ -58,7 +59,9 @@ void ScParallelismTest::setUp() { ScModelTestBase::setUp(); +#if HAVE_FEATURE_OPENCL sc::FormulaGroupInterpreter::disableOpenCL_UnitTestsOnly(); +#endif m_bThreadingFlagCfg = getThreadingFlag(); if (!m_bThreadingFlagCfg) diff --git a/sc/qa/unit/ucalc_parallelism.cxx b/sc/qa/unit/ucalc_parallelism.cxx index 2393c33b6d08..62a7657f4db8 100644 --- a/sc/qa/unit/ucalc_parallelism.cxx +++ b/sc/qa/unit/ucalc_parallelism.cxx @@ -8,6 +8,7 @@ */ #include +#include #include "helper/qahelper.hxx" @@ -55,7 +56,9 @@ void ScParallelismTest::setUp() { ScUcalcTestBase::setUp(); +#if HAVE_FEATURE_OPENCL sc::FormulaGroupInterpreter::disableOpenCL_UnitTestsOnly(); +#endif m_bThreadingFlagCfg = getThreadingFlag(); if (!m_bThreadingFlagCfg)