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

Method testFormulaAutoResizeDisabled

tests/backend/Column/ColumnTest.cpp:670–692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

668}
669
670void ColumnTest::testFormulaAutoResizeDisabled() {
671 Column sourceColumn1(QStringLiteral("source1"), Column::ColumnMode::Integer);
672 sourceColumn1.setIntegers({1, 2, 3});
673
674 Column sourceColumn2(QStringLiteral("source2"), Column::ColumnMode::Integer);
675 sourceColumn2.setIntegers({1, 2, 3});
676
677 Column targetColumn(QStringLiteral("target"), Column::ColumnMode::Integer);
678 targetColumn.setIntegers({1});
679
680 // evaluatue x+y
681 targetColumn.setColumnMode(AbstractColumn::ColumnMode::Double);
682 targetColumn.setFormula(QStringLiteral("x+y"),
683 QStringList{QStringLiteral("x"), QStringLiteral("y")},
684 QVector<Column*>({&sourceColumn1, &sourceColumn2}),
685 false /* autoUpdate */,
686 false /* autoResize */);
687 targetColumn.updateFormula();
688
689 // check the generated values in the target column which should not have been resized
690 QCOMPARE(targetColumn.rowCount(), 1);
691 QCOMPARE(targetColumn.valueAt(0), 2);
692}
693
694void ColumnTest::testFormulaAutoUpdateEnabledResize() {
695 Column sourceColumn(QStringLiteral("source"), Column::ColumnMode::Integer);

Callers

nothing calls this directly

Calls 6

setIntegersMethod · 0.80
setColumnModeMethod · 0.45
setFormulaMethod · 0.45
updateFormulaMethod · 0.45
rowCountMethod · 0.45
valueAtMethod · 0.45

Tested by

no test coverage detected