MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / testWriteWithFooter

Method testWriteWithFooter

3rdparty/qtcsv-qt5/tests/testwriter.cpp:216–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216void TestWriter::testWriteWithFooter()
217{
218 QStringList footer;
219 footer << "Here is a footer";
220
221 QStringList strList;
222 strList << "one" << "two" << "three";
223
224 QtCSV::StringData strData;
225 strData.addRow(strList);
226
227 bool writeResult = QtCSV::Writer::write(getFilePath(),
228 strData,
229 ",",
230 QString(),
231 QtCSV::Writer::REWRITE,
232 QStringList(),
233 footer);
234
235 QVERIFY2(true == writeResult, "Failed to write to file");
236
237 QList<QStringList> data = QtCSV::Reader::readToList(getFilePath());
238 QVERIFY2(false == data.isEmpty(), "Failed to read file content");
239 QVERIFY2(2 == data.size(), "Wrong number of rows");
240 QVERIFY2(strList == data.at(0), "Wrong data");
241 QVERIFY2(footer == data.at(1), "Wrong footer");
242}
243
244void TestWriter::testWriteWithHeaderAndFooter()
245{

Callers

nothing calls this directly

Calls 6

QStringClass · 0.50
QStringListClass · 0.50
addRowMethod · 0.45
isEmptyMethod · 0.45
sizeMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected