MCPcopy Create free account
hub / github.com/KDE/labplot / testFixedIncrementBigInt

Method testFixedIncrementBigInt

tests/spreadsheet/SpreadsheetGenerateDataTest.cpp:255–279  ·  view source on GitHub ↗

! * generate equidistant big int values, the increment is fixed. */

Source from the content-addressed store, hash-verified

253 * generate equidistant big int values, the increment is fixed.
254 */
255void 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.

Callers

nothing calls this directly

Calls 13

setIncrementMethod · 0.80
setFromValueMethod · 0.80
setToValueMethod · 0.80
setColumnCountMethod · 0.45
setRowCountMethod · 0.45
columnMethod · 0.45
setColumnModeMethod · 0.45
setColumnsMethod · 0.45
setTypeMethod · 0.45
generateMethod · 0.45
columnModeMethod · 0.45
rowCountMethod · 0.45

Tested by

no test coverage detected