| 504 | } |
| 505 | |
| 506 | void ColumnTest::statisticsMaskValues() { |
| 507 | Project project; |
| 508 | auto* c = new Column(QStringLiteral("Integer column"), Column::ColumnMode::Integer); |
| 509 | c->setIntegers({1, 2, 3}); |
| 510 | project.addChild(c); |
| 511 | |
| 512 | // check the statistics |
| 513 | auto& stats1 = c->statistics(); |
| 514 | QCOMPARE(stats1.size, 3); |
| 515 | QCOMPARE(stats1.minimum, 1.); |
| 516 | QCOMPARE(stats1.maximum, 3.); |
| 517 | |
| 518 | // mask the last value and check the statistics |
| 519 | c->setMasked(2); |
| 520 | auto& stats2 = c->statistics(); |
| 521 | QCOMPARE(stats2.size, 2); |
| 522 | QCOMPARE(stats2.minimum, 1.); |
| 523 | QCOMPARE(stats2.maximum, 2.); |
| 524 | |
| 525 | // undo the masking change and check the statistics |
| 526 | project.undoStack()->undo(); |
| 527 | auto& stats3 = c->statistics(); |
| 528 | QCOMPARE(stats3.size, 3); |
| 529 | QCOMPARE(stats3.minimum, 1.); |
| 530 | QCOMPARE(stats3.maximum, 3.); |
| 531 | |
| 532 | // redo the masking change and check the statistics |
| 533 | project.undoStack()->redo(); |
| 534 | auto& stats4 = c->statistics(); |
| 535 | QCOMPARE(stats4.size, 2); |
| 536 | QCOMPARE(stats4.minimum, 1.); |
| 537 | QCOMPARE(stats4.maximum, 2.); |
| 538 | } |
| 539 | |
| 540 | void ColumnTest::statisticsClearSpreadsheetMasks() { |
| 541 | Project project; |
nothing calls this directly
no test coverage detected