MCPcopy Create free account
hub / github.com/cutelyst/cutelyst / getEngine

Method getEngine

tests/teststaticcompressed.cpp:87–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87TestEngine *TestStaticCompressed::getEngine(bool serveDirsOnly)
88{
89 auto app = new TestApplication;
90 auto engine = new TestEngine(app, {});
91
92 const QVariantMap defaultConfig{{u"zlib_compression_level"_s, 1},
93 {u"brotli_quality_level"_s, 0},
94 {u"use_zopfli"_s, true},
95 {u"zopfli_iterations"_s, 5},
96 {u"zstd_compression_level"_s, 1}};
97
98 auto plug = new StaticCompressed(app, defaultConfig);
99 plug->setIncludePaths({m_dataDir.path()});
100 plug->setDirs({u"forced"_s});
101 plug->setServeDirsOnly(serveDirsOnly);
102
103 if (!engine->init()) {
104 return nullptr;
105 }
106 return engine;
107}
108
109TestEngine::TestResponse TestStaticCompressed::getFile(const QString &path, const Headers &headers)
110{

Callers

nothing calls this directly

Calls 5

setIncludePathsMethod · 0.45
pathMethod · 0.45
setDirsMethod · 0.45
setServeDirsOnlyMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected