cover inflateBack() up to common deflate data cases and after those */
| 468 | |
| 469 | /* cover inflateBack() up to common deflate data cases and after those */ |
| 470 | local 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 */ |
| 507 | local int try(char *hex, char *id, int err) |
no test coverage detected