drop/mask
| 1214 | // ********************* drop/mask ************************* |
| 1215 | // ********************************************************** |
| 1216 | void SpreadsheetTest::testRemoveRowsWithMissingValues() { |
| 1217 | // prepare the spreadsheet |
| 1218 | Spreadsheet sheet(QStringLiteral("test"), false); |
| 1219 | sheet.setColumnCount(2); |
| 1220 | sheet.setRowCount(5); |
| 1221 | |
| 1222 | auto* col0{sheet.column(0)}; |
| 1223 | col0->setColumnMode(AbstractColumn::ColumnMode::Double); |
| 1224 | col0->setValueAt(0, 0.); |
| 1225 | // missing value for row = 1 |
| 1226 | col0->setValueAt(2, 2.); |
| 1227 | col0->setValueAt(3, 3.); |
| 1228 | |
| 1229 | auto* col1{sheet.column(1)}; |
| 1230 | col1->setColumnMode(AbstractColumn::ColumnMode::Double); |
| 1231 | col1->setValueAt(0, 0.); |
| 1232 | col1->setValueAt(1, 1.); |
| 1233 | // missing value for row = 2 |
| 1234 | col1->setValueAt(3, 3.); |
| 1235 | |
| 1236 | // remove rows with empty values and check the results |
| 1237 | sheet.removeEmptyRows(); |
| 1238 | QCOMPARE(sheet.rowCount(), 2); |
| 1239 | QCOMPARE(col0->valueAt(0), 0.); |
| 1240 | QCOMPARE(col0->valueAt(1), 3.); |
| 1241 | QCOMPARE(col1->valueAt(0), 0.); |
| 1242 | QCOMPARE(col1->valueAt(1), 3.); |
| 1243 | } |
| 1244 | |
| 1245 | void SpreadsheetTest::testMaskRowsWithMissingValues() { |
| 1246 | // prepare the spreadsheet |
nothing calls this directly
no test coverage detected