* check sorting single column of double values with NaN descending */
| 526 | * check sorting single column of double values with NaN descending |
| 527 | */ |
| 528 | void SpreadsheetTest::testSortSingleNumeric2() { |
| 529 | const QVector<double> xData{0.5, -0.2, GSL_NAN, 2.0, -1.0}; |
| 530 | |
| 531 | Spreadsheet sheet(QStringLiteral("test"), false); |
| 532 | sheet.setColumnCount(1); |
| 533 | sheet.setRowCount(7); |
| 534 | auto* col = sheet.column(0); |
| 535 | col->replaceValues(0, xData); |
| 536 | |
| 537 | // sort |
| 538 | sheet.sortColumns(nullptr, {col}, false); |
| 539 | |
| 540 | // values |
| 541 | QCOMPARE(col->valueAt(0), 2.0); |
| 542 | QCOMPARE(col->valueAt(1), 0.5); |
| 543 | QCOMPARE(col->valueAt(2), -0.2); |
| 544 | QCOMPARE(col->valueAt(3), -1.0); |
| 545 | } |
| 546 | |
| 547 | /* |
| 548 | * check sorting single column of integer values with empty entries ascending |
nothing calls this directly
no test coverage detected