summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2022-07-13 23:29:58 (GMT)
committerYann Collet <cyan@fb.com>2022-07-13 23:36:18 (GMT)
commite535d6424a2952dad6db73e2882abaef76a5e5e8 (patch)
treecf03d23dcc474643215beac24165a6fc0c2e3a4f /tests
parenta3c4f0d0a31580da09a955b6783203d6c383a9e4 (diff)
downloadlz4-e535d6424a2952dad6db73e2882abaef76a5e5e8.zip
lz4-e535d6424a2952dad6db73e2882abaef76a5e5e8.tar.gz
lz4-e535d6424a2952dad6db73e2882abaef76a5e5e8.tar.bz2
implemented LZ4F_createCDict_advanced()
Diffstat (limited to 'tests')
-rw-r--r--tests/frametest.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/frametest.c b/tests/frametest.c
index 00b8acb..ec2cb12 100644
--- a/tests/frametest.c
+++ b/tests/frametest.c
@@ -143,9 +143,9 @@ static void dummy_free(void* state, void* p)
DISPLAYLEVEL(6, "freeing memory at address %p \n", p);
free(p);
assert(t != NULL);
- DISPLAYLEVEL(5, "nb of allocated memory segments before this free : %i \n", t->nbAllocs);
- assert(t->nbAllocs > 0);
t->nbAllocs -= 1;
+ DISPLAYLEVEL(5, "nb of allocated memory segments after this free : %i \n", t->nbAllocs);
+ assert(t->nbAllocs >= 0);
}
static const LZ4F_CustomMem lz4f_cmem_test = {
@@ -595,6 +595,13 @@ int basicTests(U32 seed, double compressibility)
if (cdict == NULL) goto _output_error;
CHECK( LZ4F_createCompressionContext(&cctx, LZ4F_VERSION) );
+ DISPLAYLEVEL(3, "Testing LZ4F_createCDict_advanced : ");
+ { LZ4F_CDict* const cda = LZ4F_createCDict_advanced(lz4f_cmem_test, CNBuffer, dictSize);
+ if (cda == NULL) goto _output_error;
+ LZ4F_freeCDict(cda);
+ }
+ DISPLAYLEVEL(3, "OK \n");
+
DISPLAYLEVEL(3, "LZ4F_compressFrame_usingCDict, with NULL dict : ");
CHECK_V(cSizeNoDict,
LZ4F_compressFrame_usingCDict(cctx, compressedBuffer, dstCapacity,