* check sorting single column of big int values with empty entries ascending */
| 604 | * check sorting single column of big int values with empty entries ascending |
| 605 | */ |
| 606 | void SpreadsheetTest::testSortSingleBigInt1() { |
| 607 | const QVector<qint64> xData1{40000000000, 50000000000, 20000000000}; |
| 608 | const QVector<qint64> xData2{30000000000, 60000000000, -10000000000}; |
| 609 | |
| 610 | Spreadsheet sheet(QStringLiteral("test"), false); |
| 611 | sheet.setColumnCount(1); |
| 612 | sheet.setRowCount(7); |
| 613 | auto* col = sheet.column(0); |
| 614 | col->setColumnMode(AbstractColumn::ColumnMode::BigInt); |
| 615 | col->replaceBigInt(0, xData1); |
| 616 | col->replaceBigInt(4, xData2); |
| 617 | |
| 618 | // sort |
| 619 | sheet.sortColumns(nullptr, {col}, true); |
| 620 | |
| 621 | // values |
| 622 | QCOMPARE(col->bigIntAt(0), -10000000000ll); |
| 623 | QCOMPARE(col->bigIntAt(1), 0); |
| 624 | QCOMPARE(col->bigIntAt(2), 20000000000ll); |
| 625 | QCOMPARE(col->bigIntAt(3), 30000000000ll); |
| 626 | QCOMPARE(col->bigIntAt(4), 40000000000ll); |
| 627 | QCOMPARE(col->bigIntAt(5), 50000000000ll); |
| 628 | QCOMPARE(col->bigIntAt(6), 60000000000ll); |
| 629 | } |
| 630 | |
| 631 | /* |
| 632 | * check sorting single column of big int values with empty entries descending |
nothing calls this directly
no test coverage detected