gzuncompress_error1.phpt 723 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. Test gzuncompress() function : error conditions
  3. --EXTENSIONS--
  4. zlib
  5. --FILE--
  6. <?php
  7. echo "*** Testing gzuncompress() : error conditions ***\n";
  8. echo "\n-- Testing with a buffer that is too small --\n";
  9. $data = 'string_val';
  10. $short_len = strlen($data) - 1;
  11. $compressed = gzcompress($data);
  12. var_dump(gzuncompress($compressed, $short_len));
  13. echo "\n-- Testing with incorrect arguments --\n";
  14. var_dump(gzuncompress(123));
  15. ?>
  16. --EXPECTF--
  17. *** Testing gzuncompress() : error conditions ***
  18. -- Testing with a buffer that is too small --
  19. Warning: gzuncompress(): insufficient memory in %s on line %d
  20. bool(false)
  21. -- Testing with incorrect arguments --
  22. Warning: gzuncompress(): data error in %s on line %d
  23. bool(false)