calculatorrunner: Fix autotests if Qalculate is not found

This is the case on the BSD CI build. You can try this out with the
`-DCMAKE_DISABLE_FIND_PACKAGE_Qalculate=1` cmake flag and the tests
still pass.
wilder-5.22
Alexander Lohnau 5 years ago
parent 0928bfc53b
commit e464054937
No known key found for this signature in database
GPG Key ID: 6C45BA731AA2ED36
  1. 5
      runners/calculator/autotests/calculatorrunnertest.cpp

@ -48,7 +48,9 @@ void CalculatorRunnerTest::testQuery_data()
QTest::newRow("simple power") << "2^3" << "8";
QTest::newRow("x as multiplication sign") << "25x4" << "100";
#ifdef ENABLE_QALCULATE
QTest::newRow("single digit factorial") << "5!" << "120";
#endif
QTest::newRow("hex to decimal lower case") << "0xf" << "15";
QTest::newRow("hex to decimal upper case") << "0xF" << "15";
@ -64,6 +66,9 @@ void CalculatorRunnerTest::testQuery_data()
void CalculatorRunnerTest::testApproximation()
{
#ifndef ENABLE_QALCULATE
QSKIP("Approximations are only with Qalculate supported");
#endif
launchQuery("5^1234567");
QCOMPARE(manager->matches().size(), 1);
QCOMPARE(manager->matches().constFirst().subtext(), "Approximation");

Loading…
Cancel
Save