pike.git / src / modules / Gz / testsuite.in

version» Context lines:

pike.git/src/modules/Gz/testsuite.in:14:    test_true([[Gz.inflate()->inflate(Gz.deflate(9)->deflate(____gz_tmp_constant))==____gz_tmp_constant]])    test_true([[object o=Gz.deflate(); Gz.inflate()->inflate(o->deflate(____gz_tmp_constant,o->PARTIAL_FLUSH) + o->deflate(____gz_tmp_constant,o->FINISH)) == (____gz_tmp_constant)+(____gz_tmp_constant)]])    test_do([[add_constant("____gz_tmp_constant");]])   ]])       dotest("")    dotest("foo")    dotest(sprintf("%'fomp'1000n"))    dotest(sprintf("%'fomp'100000n"))    -  test_false(Process.system(RUNPIKE+" SRCDIR/flushtest.pike")) -  test_false(Process.system(RUNPIKE+" SRCDIR/buffertest.pike")) -  +     test_true(Gz.File)    test_any([[    string orig = ((string) Array.enumerate(256)) * 1024;    object f = Gz.File("gz_test.gz", "wb");    f->write(orig);    f->close();    f = Gz.File("gz_test.gz", "rb");    rm("gz_test.gz");    string readback = f->read();    f->close();    return orig==readback;    ]], 1)    -  +  test_any([[ +  Stdio.FakeFile f = Stdio.FakeFile("","wb"); +  Gz.File g = Gz.File(f, "wb"); +  g->write("gazonk"); +  g->close(); +  return (string)f; +  ]], "\37\213\b\0\0\0\0\0\0\3KO\254\312\317\313\6\0\240\362vf\6\0\0\0") +  +  test_any([[ +  Stdio.FakeFile f = Stdio.FakeFile("","wb"); +  Gz.File g = Gz.File(f, "wb9"); +  g->write("gazonk"); +  g->close(); +  return (string)f; +  ]], "\37\213\b\0\0\0\0\0\0\3KO\254\312\317\313\6\0\240\362vf\6\0\0\0") +  +  test_any([[ +  Stdio.FakeFile f = Stdio.FakeFile("","wb"); +  Gz.File g = Gz.File(f, "wb0"); +  g->write("gazonk"); +  g->close(); +  return (string)f; +  ]], "\37\213\b\0\0\0\0\0\0\3x\1\1\6\0\371\377gazonk\b\321\2\213\240\362vf\6\0\0\0") +  +  test_any([[ +  Stdio.FakeFile f = Stdio.FakeFile("","wb"); +  Gz.File g = Gz.File(f, "wb"); +  g->setparams(0); +  g->write("gazonk"); +  g->close(); +  return (string)f; +  ]], "\37\213\b\0\0\0\0\0\0\3x\1\1\6\0\371\377gazonk\b\321\2\213\240\362vf\6\0\0\0") +     dotest(random_string(32768))    dotest(random_string(524288))       test_eq(Gz.uncompress(Gz.compress("hello")),"hello")    test_eq(Gz.uncompress(Gz.compress("")),"")    test_eq(Gz.uncompress(Gz.compress("hello",1),1),"hello")    test_eq(Gz.uncompress(Gz.compress("",1),1),"")    test_eq(Gz.uncompress(Gz.compress("a test",0,0)),"a test")    test_eq(Gz.uncompress(Gz.compress("a test",0,9)),"a test")    test_eq(Gz.compress("a test",0,9,Gz.DEFAULT_STRATEGY),Gz.compress("a test",0,9))
pike.git/src/modules/Gz/testsuite.in:80:   ]])    test_eval_error(return Gz.compress("x",0,-1);)    test_eval_error(return Gz.compress("x",0,10);)    test_eval_error(return Gz.compress("x",0,-1);)    test_eval_error(return Gz.compress("x",0,9,Gz.DEFAULT_STRATEGY,7);)    test_eval_error(return Gz.compress("x",0,9,Gz.DEFAULT_STRATEGY,16);)      ]])   cond_resolv(Gz.crc32,   [[ -  dnl Some known collisions taken from http://blog.trungson.com/?p=99 -  test_eq(Gz.crc32("a1sellers"), Gz.crc32("advertees")) -  test_eq(Gz.crc32("fc0591"), Gz.crc32("123rainerbommert")) -  test_not_eq(Gz.crc32("a1sellers"), Gz.crc32("123rainerbommert")) +  test_eq(Gz.crc32(""), 0) +  test_eq(Gz.crc32("a"), 0xe8b7be43) +  test_eq(Gz.crc32("abc"), 0x352441c2) +  test_eq(Gz.crc32("12345678901234567890123456789012345678901234567890123456789012345678901234567890"), 0x7ca94a72) +  +  test_eq(Gz.adler32(""), 1) +  test_eq(Gz.adler32("a"), 0x620062) +  test_eq(Gz.adler32("abc"), 0x24d0127) +  test_eq(Gz.adler32("12345678901234567890123456789012345678901234567890123456789012345678901234567890"), 0x97b61069)   ]])   END_MARKER