* check sorting single column of integer values with empty entries ascending */
| 548 | * check sorting single column of integer values with empty entries ascending |
| 549 | */ |
| 550 | void SpreadsheetTest::testSortSingleInteger1() { |
| 551 | const QVector<int> xData1{4, 5, 2}; |
| 552 | const QVector<int> xData2{3, 6, -1}; |
| 553 | |
| 554 | Spreadsheet sheet(QStringLiteral("test"), false); |
| 555 | sheet.setColumnCount(1); |
| 556 | sheet.setRowCount(7); |
| 557 | auto* col = sheet.column(0); |
| 558 | col->setColumnMode(AbstractColumn::ColumnMode::Integer); |
| 559 | col->replaceInteger(0, xData1); |
| 560 | col->replaceInteger(4, xData2); |
| 561 | |
| 562 | // sort |
| 563 | sheet.sortColumns(nullptr, {col}, true); |
| 564 | |
| 565 | // values |
| 566 | QCOMPARE(col->integerAt(0), -1); |
| 567 | QCOMPARE(col->integerAt(1), 0); |
| 568 | QCOMPARE(col->integerAt(2), 2); |
| 569 | QCOMPARE(col->integerAt(3), 3); |
| 570 | QCOMPARE(col->integerAt(4), 4); |
| 571 | QCOMPARE(col->integerAt(5), 5); |
| 572 | QCOMPARE(col->integerAt(6), 6); |
| 573 | } |
| 574 | |
| 575 | /* |
| 576 | * check sorting single column of integer values with empty entries ascending |
nothing calls this directly
no test coverage detected