* check sorting single column of double values with NaN ascending */
| 504 | * check sorting single column of double values with NaN ascending |
| 505 | */ |
| 506 | void SpreadsheetTest::testSortSingleNumeric1() { |
| 507 | const QVector<double> xData{0.5, -0.2, GSL_NAN, 2.0, -1.0}; |
| 508 | |
| 509 | Spreadsheet sheet(QStringLiteral("test"), false); |
| 510 | sheet.setColumnCount(1); |
| 511 | sheet.setRowCount(7); |
| 512 | auto* col = sheet.column(0); |
| 513 | col->replaceValues(0, xData); |
| 514 | |
| 515 | // sort |
| 516 | sheet.sortColumns(nullptr, {col}, true); |
| 517 | |
| 518 | // values |
| 519 | QCOMPARE(col->valueAt(0), -1.0); |
| 520 | QCOMPARE(col->valueAt(1), -0.2); |
| 521 | QCOMPARE(col->valueAt(2), 0.5); |
| 522 | QCOMPARE(col->valueAt(3), 2.0); |
| 523 | } |
| 524 | |
| 525 | /* |
| 526 | * check sorting single column of double values with NaN descending |
nothing calls this directly
no test coverage detected