! * generate equidistant big int values, the increment is fixed. */
| 253 | * generate equidistant big int values, the increment is fixed. |
| 254 | */ |
| 255 | void SpreadsheetGenerateDataTest::testFixedIncrementBigInt() { |
| 256 | Spreadsheet sheet(QStringLiteral("test"), false); |
| 257 | sheet.setColumnCount(1); |
| 258 | sheet.setRowCount(1); |
| 259 | auto* column = sheet.column(0); |
| 260 | column->setColumnMode(AbstractColumn::ColumnMode::BigInt); |
| 261 | |
| 262 | EquidistantValuesDialog dlg(&sheet); |
| 263 | dlg.setColumns(QVector<Column*>{column}); |
| 264 | dlg.setType(EquidistantValuesDialog::Type::FixedIncrement); |
| 265 | dlg.setIncrement(1); |
| 266 | dlg.setFromValue(1); |
| 267 | dlg.setToValue(5); |
| 268 | dlg.generate(); |
| 269 | |
| 270 | // checks |
| 271 | QCOMPARE(column->columnMode(), AbstractColumn::ColumnMode::BigInt); |
| 272 | QCOMPARE(sheet.rowCount(), 5); |
| 273 | QCOMPARE(column->rowCount(), 5); |
| 274 | QCOMPARE(column->bigIntAt(0), 1); |
| 275 | QCOMPARE(column->bigIntAt(1), 2); |
| 276 | QCOMPARE(column->bigIntAt(2), 3); |
| 277 | QCOMPARE(column->bigIntAt(3), 4); |
| 278 | QCOMPARE(column->bigIntAt(4), 5); |
| 279 | } |
| 280 | |
| 281 | /*! |
| 282 | * generate equidistant DateTime values, the increment is fixed. |
nothing calls this directly
no test coverage detected