MCPcopy Create free account
hub / github.com/KDE/labplot / testFormulaCellInvalid

Method testFormulaCellInvalid

tests/backend/Column/ColumnTest.cpp:1502–1515  ·  view source on GitHub ↗

! * index in cell higher than rownumber */

Source from the content-addressed store, hash-verified

1500 * index in cell higher than rownumber
1501 */
1502void ColumnTest::testFormulaCellInvalid() {
1503 auto c1 = Column(QStringLiteral("DataColumn"), Column::ColumnMode::Double);
1504 c1.replaceValues(-1, {1., 2., 3.});
1505
1506 auto c2 = Column(QStringLiteral("FormulaColumn"), Column::ColumnMode::Double);
1507 c2.replaceValues(-1, {11., 12., 13., 14., 15., 16., 17.});
1508
1509 c2.setFormula(QStringLiteral("cell(10,x)"), {QStringLiteral("x")}, QVector<Column*>({&c1}), true);
1510 c2.updateFormula();
1511 QCOMPARE(c2.rowCount(), 7);
1512 // All invalid
1513 for (int i = 0; i < c2.rowCount(); i++)
1514 VALUES_EQUAL(c2.valueAt(i), NAN);
1515}
1516
1517void ColumnTest::testFormulaCellConstExpression() {
1518 auto c1 = Column(QStringLiteral("DataColumn"), Column::ColumnMode::Double);

Callers

nothing calls this directly

Calls 6

ColumnClass · 0.50
replaceValuesMethod · 0.45
setFormulaMethod · 0.45
updateFormulaMethod · 0.45
rowCountMethod · 0.45
valueAtMethod · 0.45

Tested by

no test coverage detected