MCPcopy Create free account
hub / github.com/KDE/kdiff3 / testWhiteLineComment

Method testWhiteLineComment

src/autotests/DiffTest.cpp:185–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183 }
184
185 void testWhiteLineComment()
186 {
187 SourceDataMoc simData;
188
189 simData.setFilename(testFile.fileName());
190
191 simData.readAndPreprocess("UTF-8", true);
192 QVERIFY(simData.getErrors().isEmpty());
193 QVERIFY(!simData.isEmpty());
194 QVERIFY(simData.hasData());
195 QCOMPARE(simData.getSizeBytes(), file.size());
196
197 const std::shared_ptr<LineDataVector> &lineData = simData.getLineDataForDisplay();
198 //Verify we actually have data.
199 QVERIFY(lineData != nullptr);
200 QCOMPARE(lineData->size() - 1, 5);
201
202 QVERIFY(!(*lineData)[0].whiteLine());
203 QVERIFY((*lineData)[0].isSkipable());
204 QVERIFY((*lineData)[0].isPureComment());
205
206 QVERIFY(!(*lineData)[1].whiteLine());
207 QVERIFY(!(*lineData)[1].isPureComment());
208 QVERIFY((*lineData)[1].isSkipable());
209
210 QVERIFY((*lineData)[2].whiteLine());
211 QVERIFY(!(*lineData)[2].isPureComment());
212 QVERIFY((*lineData)[2].isSkipable());
213
214 QVERIFY(!(*lineData)[3].whiteLine());
215 QVERIFY(!(*lineData)[3].isPureComment());
216 QVERIFY(!(*lineData)[3].isSkipable());
217
218 QVERIFY((*lineData)[4].whiteLine());
219 QVERIFY(!(*lineData)[4].isPureComment());
220 QVERIFY(!(*lineData)[4].isSkipable());
221 }
222
223};
224

Callers

nothing calls this directly

Calls 10

setFilenameMethod · 0.80
fileNameMethod · 0.80
readAndPreprocessMethod · 0.80
hasDataMethod · 0.80
getSizeBytesMethod · 0.80
whiteLineMethod · 0.80
isEmptyMethod · 0.45
sizeMethod · 0.45
isSkipableMethod · 0.45
isPureCommentMethod · 0.45

Tested by

no test coverage detected