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

Method testFixedNumberBigInt

tests/spreadsheet/SpreadsheetGenerateDataTest.cpp:90–114  ·  view source on GitHub ↗

! * generate equidistant big int values, total number of values is fixed. */

Source from the content-addressed store, hash-verified

88 * generate equidistant big int values, total number of values is fixed.
89 */
90void SpreadsheetGenerateDataTest::testFixedNumberBigInt() {
91 Spreadsheet sheet(QStringLiteral("test"), false);
92 sheet.setColumnCount(1);
93 sheet.setRowCount(1);
94 auto* column = sheet.column(0);
95 column->setColumnMode(AbstractColumn::ColumnMode::BigInt);
96
97 EquidistantValuesDialog dlg(&sheet);
98 dlg.setColumns(QVector<Column*>{column});
99 dlg.setType(EquidistantValuesDialog::Type::FixedNumber);
100 dlg.setNumber(5);
101 dlg.setFromValue(1);
102 dlg.setToValue(5);
103 dlg.generate();
104
105 // checks
106 QCOMPARE(column->columnMode(), AbstractColumn::ColumnMode::BigInt);
107 QCOMPARE(sheet.rowCount(), 5);
108 QCOMPARE(column->rowCount(), 5);
109 QCOMPARE(column->bigIntAt(0), 1);
110 QCOMPARE(column->bigIntAt(1), 2);
111 QCOMPARE(column->bigIntAt(2), 3);
112 QCOMPARE(column->bigIntAt(3), 4);
113 QCOMPARE(column->bigIntAt(4), 5);
114}
115
116/*!
117 * generate equidistant DateTime values, total number of values is fixed.

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