| 668 | } |
| 669 | |
| 670 | void 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 | |
| 694 | void ColumnTest::testFormulaAutoUpdateEnabledResize() { |
| 695 | Column sourceColumn(QStringLiteral("source"), Column::ColumnMode::Integer); |
nothing calls this directly
no test coverage detected