diff --git a/src/modules/Gz/testsuite.in b/src/modules/Gz/testsuite.in index 8ca93b39b7999472dccbe964aa11dcd6510f7c28..2804f030de3e41ae9ba132bb0eda6480fc170476 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)) + ]]) ]])