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

Method testFormula

tests/backend/Column/ColumnTest.cpp:1424–1437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1422}
1423
1424void ColumnTest::testFormula() {
1425 auto c1 = Column(QStringLiteral("DataColumn"), Column::ColumnMode::Double);
1426 c1.replaceValues(-1, {1., 2., 3.});
1427
1428 auto c2 = Column(QStringLiteral("FormulaColumn"), Column::ColumnMode::Double);
1429 c2.replaceValues(-1, {11., 12., 13., 14., 15., 16., 17.});
1430
1431 c2.setFormula(QStringLiteral("mean(x)"), {QStringLiteral("x")}, QVector<Column*>({&c1}), true);
1432 c2.updateFormula();
1433 QCOMPARE(c2.rowCount(), 7);
1434 for (int i = 0; i < c2.rowCount(); i++) {
1435 VALUES_EQUAL(c2.valueAt(i), 2.);
1436 }
1437}
1438
1439void ColumnTest::testFormula2() {
1440 auto c2 = Column(QStringLiteral("FormulaColumn"), 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