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

Method testWriteWithHeader

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

Source from the content-addressed store, hash-verified

187}
188
189void TestWriter::testWriteWithHeader()
190{
191 QStringList header;
192 header << "1" << "2";
193
194 QStringList strList;
195 strList << "one" << "two" << "three";
196
197 QtCSV::StringData strData;
198 strData.addRow(strList);
199
200 bool writeResult = QtCSV::Writer::write(getFilePath(),
201 strData,
202 ",",
203 QString(),
204 QtCSV::Writer::REWRITE,
205 header);
206
207 QVERIFY2(true == writeResult, "Failed to write to file");
208
209 QList<QStringList> data = QtCSV::Reader::readToList(getFilePath());
210 QVERIFY2(false == data.isEmpty(), "Failed to read file content");
211 QVERIFY2(2 == data.size(), "Wrong number of rows");
212 QVERIFY2(header == data.at(0), "Wrong header");
213 QVERIFY2(strList == data.at(1), "Wrong data");
214}
215
216void TestWriter::testWriteWithFooter()
217{

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected