* check sorting single column of big int values with empty entries descending */
| 632 | * check sorting single column of big int values with empty entries descending |
| 633 | */ |
| 634 | void SpreadsheetTest::testSortSingleBigInt2() { |
| 635 | const QVector<qint64> xData1{40000000000, 50000000000, 20000000000}; |
| 636 | const QVector<qint64> xData2{30000000000, 60000000000, -10000000000}; |
| 637 | |
| 638 | Spreadsheet sheet(QStringLiteral("test"), false); |
| 639 | sheet.setColumnCount(1); |
| 640 | sheet.setRowCount(7); |
| 641 | auto* col = sheet.column(0); |
| 642 | col->setColumnMode(AbstractColumn::ColumnMode::BigInt); |
| 643 | col->replaceBigInt(0, xData1); |
| 644 | col->replaceBigInt(4, xData2); |
| 645 | |
| 646 | // sort |
| 647 | sheet.sortColumns(nullptr, {col}, false); |
| 648 | |
| 649 | // values |
| 650 | QCOMPARE(col->bigIntAt(6), -10000000000ll); |
| 651 | QCOMPARE(col->bigIntAt(5), 0); |
| 652 | QCOMPARE(col->bigIntAt(4), 20000000000ll); |
| 653 | QCOMPARE(col->bigIntAt(3), 30000000000ll); |
| 654 | QCOMPARE(col->bigIntAt(2), 40000000000ll); |
| 655 | QCOMPARE(col->bigIntAt(1), 50000000000ll); |
| 656 | QCOMPARE(col->bigIntAt(0), 60000000000ll); |
| 657 | } |
| 658 | |
| 659 | /* |
| 660 | * check sorting single column of text with empty entries ascending |
nothing calls this directly
no test coverage detected