MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cover_back

Function cover_back

freebsd/contrib/zlib/test/infcover.c:470–504  ·  view source on GitHub ↗

cover inflateBack() up to common deflate data cases and after those */

Source from the content-addressed store, hash-verified

468
469/* cover inflateBack() up to common deflate data cases and after those */
470local void cover_back(void)
471{
472 int ret;
473 z_stream strm;
474 unsigned char win[32768];
475
476 ret = inflateBackInit_(Z_NULL, 0, win, 0, 0);
477 assert(ret == Z_VERSION_ERROR);
478 ret = inflateBackInit(Z_NULL, 0, win); assert(ret == Z_STREAM_ERROR);
479 ret = inflateBack(Z_NULL, Z_NULL, Z_NULL, Z_NULL, Z_NULL);
480 assert(ret == Z_STREAM_ERROR);
481 ret = inflateBackEnd(Z_NULL); assert(ret == Z_STREAM_ERROR);
482 fputs("inflateBack bad parameters\n", stderr);
483
484 mem_setup(&strm);
485 ret = inflateBackInit(&strm, 15, win); assert(ret == Z_OK);
486 strm.avail_in = 2;
487 strm.next_in = (void *)"\x03";
488 ret = inflateBack(&strm, pull, Z_NULL, push, Z_NULL);
489 assert(ret == Z_STREAM_END);
490 /* force output error */
491 strm.avail_in = 3;
492 strm.next_in = (void *)"\x63\x00";
493 ret = inflateBack(&strm, pull, Z_NULL, push, &strm);
494 assert(ret == Z_BUF_ERROR);
495 /* force mode error by mucking with state */
496 ret = inflateBack(&strm, pull, &strm, push, Z_NULL);
497 assert(ret == Z_STREAM_ERROR);
498 ret = inflateBackEnd(&strm); assert(ret == Z_OK);
499 mem_done(&strm, "inflateBack bad state");
500
501 ret = inflateBackInit(&strm, 15, win); assert(ret == Z_OK);
502 ret = inflateBackEnd(&strm); assert(ret == Z_OK);
503 fputs("inflateBack built-in memory routines\n", stderr);
504}
505
506/* do a raw inflate of data in hexadecimal with both inflate and inflateBack */
507local int try(char *hex, char *id, int err)

Callers 1

mainFunction · 0.85

Calls 5

inflateBackInit_Function · 0.85
inflateBackFunction · 0.85
inflateBackEndFunction · 0.85
mem_setupFunction · 0.85
mem_doneFunction · 0.85

Tested by

no test coverage detected