@@ -2592,6 +2592,27 @@ static int basicUnitTests(U32 const seed, double compressibility)
2592
2592
}
2593
2593
DISPLAYLEVEL (3 , "OK \n" );
2594
2594
2595
+ DISPLAYLEVEL (3 , "test%3d : bufferless api with cdict : " , testNb ++ );
2596
+ { ZSTD_CDict * const cdict = ZSTD_createCDict (dictBuffer , dictSize , 1 );
2597
+ ZSTD_DCtx * const dctx = ZSTD_createDCtx ();
2598
+ ZSTD_frameParameters const fParams = { 0 , 1 , 0 };
2599
+ size_t cBlockSize ;
2600
+ cSize = 0 ;
2601
+ CHECK_Z (ZSTD_compressBegin_usingCDict_advanced (cctx , cdict , fParams , ZSTD_CONTENTSIZE_UNKNOWN ));
2602
+ cBlockSize = ZSTD_compressContinue (cctx , (char * )compressedBuffer + cSize , compressedBufferSize - cSize , CNBuffer , 1000 );
2603
+ CHECK_Z (cBlockSize );
2604
+ cSize += cBlockSize ;
2605
+ cBlockSize = ZSTD_compressEnd (cctx , (char * )compressedBuffer + cSize , compressedBufferSize - cSize , (char const * )CNBuffer + 2000 , 1000 );
2606
+ CHECK_Z (cBlockSize );
2607
+ cSize += cBlockSize ;
2608
+
2609
+ CHECK_Z (ZSTD_decompress_usingDict (dctx , decodedBuffer , CNBuffSize , compressedBuffer , cSize , dictBuffer , dictSize ));
2610
+
2611
+ ZSTD_freeCDict (cdict );
2612
+ ZSTD_freeDCtx (dctx );
2613
+ }
2614
+ DISPLAYLEVEL (3 , "OK \n" );
2615
+
2595
2616
DISPLAYLEVEL (3 , "test%3i : Building cdict w/ ZSTD_dct_fullDict on a good dictionary : " , testNb ++ );
2596
2617
{ ZSTD_compressionParameters const cParams = ZSTD_getCParams (1 , CNBuffSize , dictSize );
2597
2618
ZSTD_CDict * const cdict = ZSTD_createCDict_advanced (dictBuffer , dictSize , ZSTD_dlm_byRef , ZSTD_dct_fullDict , cParams , ZSTD_defaultCMem );
0 commit comments