Make use of the new CellReference class
This commit is contained in:
@@ -35,12 +35,6 @@ public:
|
||||
UtilityTest();
|
||||
|
||||
private Q_SLOTS:
|
||||
void test_cell_to_rowcol();
|
||||
void test_cell_to_rowcol_data();
|
||||
|
||||
void test_rowcol_to_cell();
|
||||
void test_rowcol_to_cell_data();
|
||||
|
||||
void test_datetimeToNumber_data();
|
||||
void test_datetimeToNumber();
|
||||
|
||||
@@ -58,62 +52,6 @@ UtilityTest::UtilityTest()
|
||||
{
|
||||
}
|
||||
|
||||
void UtilityTest::test_cell_to_rowcol()
|
||||
{
|
||||
QFETCH(QString, cell);
|
||||
QFETCH(int, row);
|
||||
QFETCH(int, col);
|
||||
QPoint pos = QXlsx::xl_cell_to_rowcol(cell);
|
||||
QCOMPARE(pos.x(), row);
|
||||
QCOMPARE(pos.y(), col);
|
||||
}
|
||||
|
||||
void UtilityTest::test_cell_to_rowcol_data()
|
||||
{
|
||||
QTest::addColumn<QString>("cell");
|
||||
QTest::addColumn<int>("row");
|
||||
QTest::addColumn<int>("col");
|
||||
|
||||
QTest::newRow("A1") << "A1" << 1 << 1;
|
||||
QTest::newRow("B1") << "B1" << 1 << 2;
|
||||
QTest::newRow("C1") << "C1" << 1 << 3;
|
||||
QTest::newRow("J1") << "J1" << 1 << 10;
|
||||
QTest::newRow("A2") << "A2" << 2 << 1;
|
||||
QTest::newRow("A3") << "A3" << 3 << 1;
|
||||
QTest::newRow("A10") << "A10" << 10 << 1;
|
||||
QTest::newRow("Z8") << "Z8" << 8 << 26;
|
||||
QTest::newRow("AA10") << "AA10" << 10 << 27;
|
||||
QTest::newRow("IU2") << "IU2" << 2 << 255;
|
||||
QTest::newRow("XFD1") << "XFD1" << 1 << 16384;
|
||||
QTest::newRow("XFE1048577") << "XFE1048577" << 1048577 << 16385;
|
||||
}
|
||||
|
||||
void UtilityTest::test_rowcol_to_cell()
|
||||
{
|
||||
QFETCH(int, row);
|
||||
QFETCH(int, col);
|
||||
QFETCH(bool, row_abs);
|
||||
QFETCH(bool, col_abs);
|
||||
QFETCH(QString, cell);
|
||||
|
||||
QCOMPARE(QXlsx::xl_rowcol_to_cell(row, col, row_abs, col_abs), cell);
|
||||
}
|
||||
|
||||
void UtilityTest::test_rowcol_to_cell_data()
|
||||
{
|
||||
QTest::addColumn<int>("row");
|
||||
QTest::addColumn<int>("col");
|
||||
QTest::addColumn<bool>("row_abs");
|
||||
QTest::addColumn<bool>("col_abs");
|
||||
QTest::addColumn<QString>("cell");
|
||||
|
||||
QTest::newRow("simple") << 1 << 1 << false << false << "A1";
|
||||
QTest::newRow("rowabs") << 1 << 1 << true << false << "A$1";
|
||||
QTest::newRow("colabs") << 1 << 1 << false << true << "$A1";
|
||||
QTest::newRow("bothabs") << 1 << 1 << true << true << "$A$1";
|
||||
QTest::newRow("...") << 1048577 << 16385 << false << false << "XFE1048577";
|
||||
}
|
||||
|
||||
void UtilityTest::test_datetimeToNumber_data()
|
||||
{
|
||||
QTest::addColumn<QDateTime>("dt");
|
||||
|
||||
Reference in New Issue
Block a user