| 352 | } |
| 353 | |
| 354 | void ExpressionParserTest::testevaluateCartesianConstExpr() { |
| 355 | const QString expr = QStringLiteral("5 + 5"); |
| 356 | const QStringList vars = {QStringLiteral("x"), QStringLiteral("y")}; |
| 357 | |
| 358 | QVector<QVector<double>*> xVectors; |
| 359 | |
| 360 | xVectors << new QVector<double>({1., 2., 3.}); // x |
| 361 | xVectors << new QVector<double>({4., 5., 6., 9.}); // y |
| 362 | QVector<double> yVector({101., 123., 345., 239., 1290., 43290., 238., 342., 823., 239.}); |
| 363 | auto* parser = ExpressionParser::getInstance(); |
| 364 | parser->tryEvaluateCartesian(expr, vars, xVectors, &yVector); |
| 365 | |
| 366 | QCOMPARE(yVector.size(), 10); |
| 367 | // All yVector rows are filled |
| 368 | for (const auto v : yVector) |
| 369 | QCOMPARE(v, 5. + 5.); |
| 370 | } |
| 371 | |
| 372 | void ExpressionParserTest::testEvaluateAnd() { |
| 373 | const QString expr = QStringLiteral("x && y"); |
nothing calls this directly
no test coverage detected