! 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. */
| 73 | the first column has to be converted to integer column, the second to big integer. |
| 74 | */ |
| 75 | void 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. |
nothing calls this directly
no test coverage detected