Skip to content

Commit f2d9652

Browse files
committed
more usage of new error code stabilityCondition_notRespected
as suggested by @terrelln
1 parent dda4c10 commit f2d9652

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/compress/zstd_compress.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5558,13 +5558,13 @@ static size_t ZSTD_checkBufferStability(ZSTD_CCtx const* cctx,
55585558
if (cctx->appliedParams.inBufferMode == ZSTD_bm_stable) {
55595559
ZSTD_inBuffer const expect = cctx->expectedInBuffer;
55605560
if (expect.src != input->src || expect.pos != input->pos)
5561-
RETURN_ERROR(srcBuffer_wrong, "ZSTD_c_stableInBuffer enabled but input differs!");
5561+
RETURN_ERROR(stabilityCondition_notRespected, "ZSTD_c_stableInBuffer enabled but input differs!");
55625562
}
55635563
(void)endOp;
55645564
if (cctx->appliedParams.outBufferMode == ZSTD_bm_stable) {
55655565
size_t const outBufferSize = output->size - output->pos;
55665566
if (cctx->expectedOutBufferSize != outBufferSize)
5567-
RETURN_ERROR(dstBuffer_wrong, "ZSTD_c_stableOutBuffer enabled but output size differs!");
5567+
RETURN_ERROR(stabilityCondition_notRespected, "ZSTD_c_stableOutBuffer enabled but output size differs!");
55685568
}
55695569
return 0;
55705570
}

tests/zstreamtest.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ static int basicUnitTests(U32 seed, double compressibility)
868868
in.pos = 0;
869869
{ size_t const ret = ZSTD_compressStream2(cctx, &out, &in, ZSTD_e_end);
870870
CHECK(!ZSTD_isError(ret), "Must error");
871-
CHECK(!(ZSTD_getErrorCode(ret) == ZSTD_error_srcBuffer_wrong), "Must be this error");
871+
CHECK(!(ZSTD_getErrorCode(ret) == ZSTD_error_stabilityCondition_notRespected), "Must be this error");
872872
}
873873
DISPLAYLEVEL(3, "OK \n");
874874

@@ -963,7 +963,7 @@ static int basicUnitTests(U32 seed, double compressibility)
963963
in.pos = out.pos = 0;
964964
{ size_t const ret = ZSTD_compressStream2(cctx, &out, &in, ZSTD_e_continue);
965965
CHECK(!ZSTD_isError(ret), "Must have errored");
966-
CHECK(!(ZSTD_getErrorCode(ret) == ZSTD_error_dstBuffer_wrong), "Must be this error");
966+
CHECK(!(ZSTD_getErrorCode(ret) == ZSTD_error_stabilityCondition_notRespected), "Must be this error");
967967
}
968968
DISPLAYLEVEL(3, "OK \n");
969969

0 commit comments

Comments
 (0)