| 204 | }; |
| 205 | |
| 206 | static std::vector<Byte> compressWithContentSize(const Byte* src, size_t srcSize) { |
| 207 | auto* cctx = ZSTD_createCCtx(); |
| 208 | ZSTD_CCtx_setParameter(cctx, ZSTD_c_contentSizeFlag, 1); |
| 209 | auto bound = ZSTD_compressBound(srcSize); |
| 210 | std::vector<Byte> out(bound); |
| 211 | auto sz = ZSTD_compress2(cctx, out.data(), out.size(), src, srcSize); |
| 212 | EXPECT_FALSE(ZSTD_isError(sz)); |
| 213 | out.resize(sz); |
| 214 | ZSTD_freeCCtx(cctx); |
| 215 | return out; |
| 216 | } |
| 217 | |
| 218 | } // namespace |
| 219 |
no test coverage detected