1169d92004-05-02Martin Nilsson START_MARKER dnl $Id: testsuite.in,v 1.7 2004/05/02 18:44:33 nilsson Exp $
24ddc71998-03-28Henrik Grubbström (Grubba) 
a80a9c1997-02-11Fredrik Hübinette (Hubbe) dnl gdbm
d61a0b1997-04-10Fredrik Hübinette (Hubbe) cond( [[ master()->resolv("Gdbm")->gdbm ]],
a80a9c1997-02-11Fredrik Hübinette (Hubbe) [[
457cf02002-11-26Martin Nilsson  test_true(programp(Gdbm.gdbm)) test_do(destruct(Gdbm.gdbm()))
a80a9c1997-02-11Fredrik Hübinette (Hubbe)  define([[GDBMTESTS]], [[ test_do(rm("test.gdbm"))
457cf02002-11-26Martin Nilsson  test_do(add_constant("GDBMBASE",Gdbm.gdbm("test.gdbm")))
a80a9c1997-02-11Fredrik Hübinette (Hubbe)  test_true(file_stat("test.gdbm")) GDBMNULLTEST test_true(GDBMBASE->store("foo","bar")) GDBMNULLTEST test_equal(GDBMBASE->fetch("foo"),"bar") test_do([[int e; for(e=0;e<100;e++) GDBMBASE->store("x"+e,"y"+e)]]) GDBMNULLTEST test_any(int e; for(e=0;e<100;e++) if(GDBMBASE->fetch("x"+e)!="y"+e) return e; return -1,-1) GDBMNULLTEST test_true(GDBMBASE->store(sprintf("%'23'100000s","") , sprintf("%'32'100000s",""))) test_true(GDBMBASE->fetch(sprintf("%'23'100000s",""))==sprintf("%'32'100000s","")) GDBMNULLTEST test_equal(GDBMBASE->fetch("foo"),"bar") test_any(int e; for(e=0;e<100;e++) if(GDBMBASE->fetch("x"+e)!="y"+e) return e; return -1,-1) test_true(GDBMBASE->fetch(sprintf("%'23'100000s",""))==sprintf("%'32'100000s","")) test_any(int e; string k; for(k=GDBMBASE->firstkey();k;k=GDBMBASE->nextkey(k)) e++; return e,102) test_do(GDBMBASE->sync()) test_do(GDBMBASE->reorganize()) test_do(GDBMBASE->close()) ]]) define([[GDBMNULLTEST]],[[ test_false(GDBMBASE->fetch("slakjdfasdf")) ]]) GDBMTESTS define([[GDBMNULLTEST]],[[ test_false(GDBMBASE->fetch("slakjdfasdf")) test_do(GDBMBASE->reorganize()) test_do(GDBMBASE->sync()) test_do(GDBMBASE->close()) test_do(GDBMBASE->create("test.gdbm")) ]]) GDBMTESTS test_do(rm("test.gdbm"))
ec1d432002-10-28Martin Nilsson  test_do(add_constant("GDBMBASE"))
a80a9c1997-02-11Fredrik Hübinette (Hubbe) ]])
1169d92004-05-02Martin Nilsson END_MARKER