From 87b8bed58b9e2a9a9128a717bfbc8f9a20b95503 Mon Sep 17 00:00:00 2001 From: "Mirar (Pontus Hagland)" <pike@sort.mirar.org> Date: Tue, 8 Jun 1999 15:14:03 +0200 Subject: [PATCH] new tests that detects the previous errors with buffer Rev: src/modules/Gz/testsuite.in:1.5 --- src/modules/Gz/testsuite.in | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/modules/Gz/testsuite.in b/src/modules/Gz/testsuite.in index 8ca93b39b7..2804f030de 100644 --- a/src/modules/Gz/testsuite.in +++ b/src/modules/Gz/testsuite.in @@ -1,4 +1,4 @@ -// $Id: testsuite.in,v 1.4 1998/03/28 14:49:35 grubba Exp $ +// $Id: testsuite.in,v 1.5 1999/06/08 13:14:03 mirar Exp $ cond([[ master()->resolv("Gz")->deflate ]], [[ @@ -6,14 +6,23 @@ cond([[ master()->resolv("Gz")->deflate ]], test_true(Gz.deflate()->deflate) test_true(Gz.inflate()) test_true(Gz.inflate()->inflate) + define(dotest,[[ test_true(Gz.deflate(1)->deflate($1)) - test_eq(Gz.inflate()->inflate(Gz.deflate(1)->deflate($1)),$1) - test_eq(Gz.inflate()->inflate(Gz.deflate(9)->deflate($1)),$1) - test_any([[object o=Gz.deflate(); return Gz.inflate()->inflate(o->deflate($1,o->PARTIAL_FLUSH) + o->deflate($1,o->FINISH))]], [[($1)+($1)]]) + test_true(string s=($1); Gz.inflate()->inflate(Gz.deflate(1)->deflate(s))==s) + test_true(string s=($1); Gz.inflate()->inflate(Gz.deflate(9)->deflate(s))==s) + test_true(string s=($1); object o=Gz.deflate(); Gz.inflate()->inflate(o->deflate(s,o->PARTIAL_FLUSH) + o->deflate(s,o->FINISH)) == (s)+(s)]]) ]]) + dotest("") dotest("foo") dotest(sprintf("%'fomp'1000n")) dotest(sprintf("%'fomp'100000n")) + + cond([[ master()->resolv("Crypto") && master()->resolv("Crypto")["randomness"] ]], + [[ + dotest(Crypto.randomness.pike_random()->read(32768)) + dotest(Crypto.randomness.pike_random()->read(524288)) + dotest(Crypto.randomness.pike_random()->read(8388608)) + ]]) ]]) -- GitLab