| 85 | } |
| 86 | |
| 87 | TestEngine *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 | |
| 109 | TestEngine::TestResponse TestStaticCompressed::getFile(const QString &path, const Headers &headers) |
| 110 | { |
nothing calls this directly
no test coverage detected