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

Method testCopyPasteColumnMode01

tests/spreadsheet/SpreadsheetTest.cpp:75–103  ·  view source on GitHub ↗

! insert one column with integer and one column with big integer values into an empty spreadsheet. the first column has to be converted to integer column, the second to big integer. */

Source from the content-addressed store, hash-verified

73 the first column has to be converted to integer column, the second to big integer.
74*/
75void SpreadsheetTest::testCopyPasteColumnMode01() {
76#ifdef __FreeBSD__
77 return;
78#endif
79 Spreadsheet sheet(QStringLiteral("test"), false);
80 sheet.setColumnCount(2);
81 sheet.setRowCount(100);
82
83 const QString str = QStringLiteral("10 ") + QString::number(std::numeric_limits<long long>::min()) + QStringLiteral("\n20 ")
84 + QString::number(std::numeric_limits<long long>::max());
85 QApplication::clipboard()->setText(str);
86
87 SpreadsheetView view(&sheet, false);
88 view.pasteIntoSelection();
89
90 // spreadsheet size
91 QCOMPARE(sheet.columnCount(), 2);
92 QCOMPARE(sheet.rowCount(), 100);
93
94 // column modes
95 QCOMPARE(sheet.column(0)->columnMode(), AbstractColumn::ColumnMode::Integer);
96 QCOMPARE(sheet.column(1)->columnMode(), AbstractColumn::ColumnMode::BigInt);
97
98 // values
99 QCOMPARE(sheet.column(0)->integerAt(0), 10);
100 QCOMPARE(sheet.column(1)->bigIntAt(0), std::numeric_limits<long long>::min());
101 QCOMPARE(sheet.column(0)->integerAt(1), 20);
102 QCOMPARE(sheet.column(1)->bigIntAt(1), std::numeric_limits<long long>::max());
103}
104
105/*!
106 insert one column with integer values and one column with float numbers into an empty spreadsheet.

Callers

nothing calls this directly

Calls 10

setColumnCountMethod · 0.45
setRowCountMethod · 0.45
setTextMethod · 0.45
pasteIntoSelectionMethod · 0.45
columnCountMethod · 0.45
rowCountMethod · 0.45
columnModeMethod · 0.45
columnMethod · 0.45
integerAtMethod · 0.45
bigIntAtMethod · 0.45

Tested by

no test coverage detected