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

Method testFixedNumberIntToBigInt

tests/spreadsheet/SpreadsheetGenerateDataTest.cpp:440–464  ·  view source on GitHub ↗

! * generate equidistant big int values, total number of values is fixed, the initial int column mode needs to be adjusted. */

Source from the content-addressed store, hash-verified

438 * generate equidistant big int values, total number of values is fixed, the initial int column mode needs to be adjusted.
439 */
440void SpreadsheetGenerateDataTest::testFixedNumberIntToBigInt() {
441 Spreadsheet sheet(QStringLiteral("test"), false);
442 sheet.setColumnCount(1);
443 sheet.setRowCount(1);
444 auto* column = sheet.column(0);
445 column->setColumnMode(AbstractColumn::ColumnMode::Integer);
446
447 EquidistantValuesDialog dlg(&sheet);
448 dlg.setColumns(QVector<Column*>{column});
449 dlg.setType(EquidistantValuesDialog::Type::FixedNumber);
450 dlg.setNumber(5);
451 dlg.setFromValue(2147483647.);
452 dlg.setToValue(2147483651.);
453 dlg.generate();
454
455 // checks
456 QCOMPARE(column->columnMode(), AbstractColumn::ColumnMode::BigInt);
457 QCOMPARE(sheet.rowCount(), 5);
458 QCOMPARE(column->rowCount(), 5);
459 QCOMPARE(column->bigIntAt(0), 2147483647);
460 QCOMPARE(column->bigIntAt(1), 2147483648);
461 QCOMPARE(column->bigIntAt(2), 2147483649);
462 QCOMPARE(column->bigIntAt(3), 2147483650);
463 QCOMPARE(column->bigIntAt(4), 2147483651);
464}
465
466/*!
467 * generate equidistant double values, total number of values is fixed, the initial int column mode needs to be adjusted.

Callers

nothing calls this directly

Calls 13

setNumberMethod · 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