MCPcopy Create free account
hub / github.com/KDE/kdevelop / applyFormatting

Function applyFormatting

kdevplatform/util/tests/test_kdevformatsource.cpp:31–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29
30namespace {
31QString applyFormatting(const QString& path, bool expectedFormattingResult)
32{
33 KDevFormatFile formatFile(path, path);
34 if (!formatFile.find()) {
35 return "found no format_sources file for " + path;
36 }
37 if (!formatFile.read()) {
38 return "reading format_sources file failed for " + path;
39 }
40 if (formatFile.apply() != expectedFormattingResult) {
41 if (expectedFormattingResult) {
42 return "formatting was expected to succeed but actually failed for " + path;
43 } else {
44 return "formatting was expected to fail but actually succeeded for " + path;
45 }
46 }
47 return QString{};
48}
49}
50
51TestKdevFormatSource::TestKdevFormatSource()

Callers 1

Calls 3

findMethod · 0.45
readMethod · 0.45
applyMethod · 0.45

Tested by

no test coverage detected