| 87 | } |
| 88 | |
| 89 | void TestStringData::testInsertRows() { |
| 90 | QList<QString> valuesFirst, valuesSecond; |
| 91 | valuesFirst << "one" << "two" << "three"; |
| 92 | valuesSecond << "asgreg" << "ertetw" << ""; |
| 93 | |
| 94 | QString stringOne("hey test"), stringTwo("sdfwioiouoioi"); |
| 95 | |
| 96 | QtCSV::StringData strData; |
| 97 | strData.insertRow(0, valuesFirst); |
| 98 | |
| 99 | QVERIFY2(1 == strData.rowCount(), "Wrong number of rows"); |
| 100 | QVERIFY2(valuesFirst == strData.rowValues(0), "Wrong data for first row"); |
| 101 | |
| 102 | strData.addEmptyRow(); |
| 103 | strData.addRow(stringOne); |
| 104 | strData.insertRow(1, valuesSecond); |
| 105 | strData.insertRow(100, stringTwo); |
| 106 | |
| 107 | QVERIFY2(5 == strData.rowCount(), "Wrong number of rows"); |
| 108 | QVERIFY2(valuesFirst == strData.rowValues(0), "Wrong data for first row"); |
| 109 | QVERIFY2(valuesSecond == strData.rowValues(1), "Wrong data for second row"); |
| 110 | QVERIFY2(strData.rowValues(2).isEmpty(), "Wrong data for third row"); |
| 111 | QVERIFY2((QList<QString>() << stringOne) == strData.rowValues(3), |
| 112 | "Wrong data for fourth row"); |
| 113 | |
| 114 | QVERIFY2((QList<QString>() << stringTwo) == strData.rowValues(4), |
| 115 | "Wrong data for fifth row"); |
| 116 | } |
| 117 | |
| 118 | void TestStringData::testCompareForEquality() { |
| 119 | QList<QString> firstRow, secondRow; |