| 220 | } |
| 221 | |
| 222 | void TestVariantData::testCopyConstruction() |
| 223 | { |
| 224 | QStringList firstRow, secondRow; |
| 225 | firstRow << "one" << "two" << "three"; |
| 226 | secondRow << "four" << "five"; |
| 227 | |
| 228 | QtCSV::VariantData firstData; |
| 229 | firstData.addRow(firstRow); |
| 230 | firstData.addRow(secondRow); |
| 231 | |
| 232 | { |
| 233 | QtCSV::VariantData secondData(firstData); |
| 234 | |
| 235 | QVERIFY2(firstData.rowCount() == secondData.rowCount(), |
| 236 | "Wrong number of rows"); |
| 237 | QVERIFY2(firstRow == secondData.rowValues(0), |
| 238 | "Wrong data for first row"); |
| 239 | QVERIFY2(secondRow == secondData.rowValues(1), |
| 240 | "Wrong data for second row"); |
| 241 | } |
| 242 | |
| 243 | QVERIFY2(2 == firstData.rowCount(), "Wrong number of rows"); |
| 244 | QVERIFY2(firstRow == firstData.rowValues(0), "Wrong data for first row"); |
| 245 | QVERIFY2(secondRow == firstData.rowValues(1), "Wrong data for second row"); |
| 246 | } |
| 247 | |
| 248 | void TestVariantData::testCopyAssignment() |
| 249 | { |