]> granicus.if.org Git - php/commitdiff
DBA tests: cleanup and sycn. Add new Berkeley DB 4 tests
authorChristopher Jones <sixd@php.net>
Fri, 5 Mar 2010 00:23:26 +0000 (00:23 +0000)
committerChristopher Jones <sixd@php.net>
Fri, 5 Mar 2010 00:23:26 +0000 (00:23 +0000)
40 files changed:
ext/dba/tests/bug36436.phpt
ext/dba/tests/bug38698.phpt
ext/dba/tests/bug48240.phpt
ext/dba/tests/bug49125.phpt
ext/dba/tests/dba001.phpt
ext/dba/tests/dba002.phpt
ext/dba/tests/dba003.phpt
ext/dba/tests/dba004.phpt
ext/dba/tests/dba005.phpt
ext/dba/tests/dba006.phpt
ext/dba/tests/dba007.phpt
ext/dba/tests/dba008.phpt
ext/dba/tests/dba009.phpt
ext/dba/tests/dba010.phpt
ext/dba/tests/dba_cdb.phpt
ext/dba/tests/dba_cdb_make.phpt
ext/dba/tests/dba_db4_000.phpt [moved from ext/dba/tests/dba_db4.phpt with 74% similarity]
ext/dba/tests/dba_db4_001.phpt [new file with mode: 0644]
ext/dba/tests/dba_db4_002.phpt [new file with mode: 0644]
ext/dba/tests/dba_db4_003.phpt [new file with mode: 0644]
ext/dba/tests/dba_db4_004.phpt [new file with mode: 0644]
ext/dba/tests/dba_db4_005.phpt [new file with mode: 0644]
ext/dba/tests/dba_db4_006.phpt [new file with mode: 0644]
ext/dba/tests/dba_db4_007.phpt [new file with mode: 0644]
ext/dba/tests/dba_db4_008.phpt [new file with mode: 0644]
ext/dba/tests/dba_db4_009.phpt [new file with mode: 0644]
ext/dba/tests/dba_db4_010.phpt [new file with mode: 0644]
ext/dba/tests/dba_db4_011.phpt [new file with mode: 0644]
ext/dba/tests/dba_db4_012.phpt [new file with mode: 0644]
ext/dba/tests/dba_db4_013.phpt [new file with mode: 0644]
ext/dba/tests/dba_db4_014.phpt [new file with mode: 0644]
ext/dba/tests/dba_db4_015.phpt [new file with mode: 0644]
ext/dba/tests/dba_db4_016.phpt [new file with mode: 0644]
ext/dba/tests/dba_db4_handlers.phpt [new file with mode: 0644]
ext/dba/tests/dba_db4_optimize.phpt [new file with mode: 0644]
ext/dba/tests/dba_db4_sync.phpt [new file with mode: 0644]
ext/dba/tests/dba_flatfile.phpt
ext/dba/tests/dba_handlers.phpt [new file with mode: 0644]
ext/dba/tests/dba_optimize.phpt
ext/dba/tests/dba_sync.phpt

index 4e8daa860039845951dcfe5ad261c0721d3d488b..19254df3c77b34dd1f22464ca377b6e0b980d7bb 100755 (executable)
@@ -3,13 +3,13 @@ Bug #36436 (DBA problem with Berkeley DB4)
 --SKIPIF--
 <?php 
        $handler = 'db4';
-       require_once dirname(__FILE__) .'/skipif.inc';
+       require_once(dirname(__FILE__) .'/skipif.inc');
 ?>
 --FILE--
 <?php
 
 $handler = 'db4';
-require_once dirname(__FILE__) .'/test.inc';
+require_once(dirname(__FILE__) .'/test.inc');
 
 $db = dba_popen($db_filename, 'c', 'db4');
 
@@ -22,10 +22,13 @@ var_dump(dba_firstkey($db));
 var_dump(dba_nextkey($db));
 
 dba_close($db);
-unlink($db_filename);
 
 ?>
 ===DONE===
+--CLEAN--
+<?php 
+       require(dirname(__FILE__) .'/clean.inc'); 
+?>
 --EXPECTF--
 resource(%d) of type (dba persistent)
 string(3) "XYZ"
index ca607419bd5fc25c1db185ba2211c83f6b703060..319d9de3c840729575b2a4d7f79ccd770f6c5c62 100755 (executable)
@@ -3,7 +3,7 @@ Bug #38698 (Bug #38698 for some keys cdbmake creates corrupted db and cdb can't
 --SKIPIF--
 <?php 
        $handler = 'cdb_make';
-       require_once dirname(__FILE__) .'/skipif.inc';
+       require_once(dirname(__FILE__) .'/skipif.inc');
 ?>
 --FILE--
 <?php
index 27f8d95e6ef659d551614735d12a0742e577e895..5a72073f360c1056ff7d0bd6be10ea242a01dc65 100644 (file)
@@ -3,23 +3,26 @@ Bug #48240 (DBA Segmentation fault dba_nextkey)
 --SKIPIF--
 <?php 
        $handler = 'db4';
-       require_once dirname(__FILE__) .'/skipif.inc';
+       require_once(dirname(__FILE__) .'/skipif.inc');
 ?>
 --FILE--
 <?php
 
 $handler = 'db4';
-require_once dirname(__FILE__) .'/test.inc';
+require_once(dirname(__FILE__) .'/test.inc');
 
 $db = dba_open($db_filename, 'c', 'db4');
 
 var_dump(dba_nextkey($db));
 
 dba_close($db);
-unlink($db_filename);
 
 ?>
 ===DONE===
+--CLEAN--
+<?php 
+       require(dirname(__FILE__) .'/clean.inc'); 
+?>
 --EXPECT--
 bool(false)
 ===DONE===
index 3724b89c938c61f0e5fdadf51040c2fc36ebf00b..e06495a109d37ae48bbd9b603d88c30c862a6c28 100644 (file)
@@ -3,7 +3,7 @@ Bug #49125 (Error in dba_exists C code)
 --SKIPIF--
 <?php 
        $handler = 'db4';
-       require_once dirname(__FILE__) .'/skipif.inc';
+       require_once(dirname(__FILE__) .'/skipif.inc');
 ?>
 --FILE--
 <?php
@@ -11,7 +11,7 @@ Bug #49125 (Error in dba_exists C code)
 error_reporting(E_ALL);
 
 $handler = 'db4';
-require_once dirname(__FILE__) .'/test.inc';
+require_once(dirname(__FILE__) .'/test.inc');
 
 $db = dba_popen($db_filename, 'c', 'db4');
 
@@ -21,7 +21,10 @@ var_dump(dba_exists('foo', $db));
 
 dba_close($db);
 
-unlink($db_filename);
-
+?>
+--CLEAN--
+<?php 
+       require(dirname(__FILE__) .'/clean.inc'); 
+?>
 --EXPECT--
 bool(true)
index 00aec6969762b16d9ea514b53f022eaeb8d72ce4..b63829abbf211dedc1e2d01f85614e421ada1fd1 100644 (file)
@@ -2,12 +2,12 @@
 DBA File Creation Test
 --SKIPIF--
 <?php 
-       require_once dirname(__FILE__) .'/skipif.inc';
+       require_once(dirname(__FILE__) .'/skipif.inc');
        die("info $HND handler used");
 ?>
 --FILE--
 <?php
-       require_once dirname(__FILE__) .'/test.inc';
+       require_once(dirname(__FILE__) .'/test.inc');
        echo "database handler: $handler\n";
        if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
        echo "database file created\n";
@@ -16,6 +16,10 @@ DBA File Creation Test
        echo "$db_file does not exist\n";
     }
 ?>
+--CLEAN--
+<?php 
+       require(dirname(__FILE__) .'/clean.inc'); 
+?>
 --EXPECTF--
 database handler: %s
 database file created
index 974b09fab8ee7238941dec866f4499a34ff453cd..e60e7336036876404e042b0836dd4397f9d05aad 100644 (file)
@@ -2,12 +2,12 @@
 DBA Insert/Fetch Test
 --SKIPIF--
 <?php 
-       require_once dirname(__FILE__) .'/skipif.inc';
+       require_once(dirname(__FILE__) .'/skipif.inc');
        die("info $HND handler used");
 ?>
 --FILE--
 <?php
-       require_once dirname(__FILE__) .'/test.inc';
+       require_once(dirname(__FILE__) .'/test.inc');
        echo "database handler: $handler\n";
        if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
                dba_insert("key1", "This is a test insert", $db_file);
@@ -17,6 +17,10 @@ DBA Insert/Fetch Test
                echo "Error creating database\n";
        }
 ?>
+--CLEAN--
+<?php 
+       require(dirname(__FILE__) .'/clean.inc'); 
+?>
 --EXPECTF--
 database handler: %s
 This is a test insert
index 832c7a0dc9c5d11dac7e5614f28450dc59280028..a027b5356edc8db374817db908389a70b6f0d82d 100644 (file)
@@ -2,12 +2,12 @@
 DBA Insert/Replace/Fetch Test
 --SKIPIF--
 <?php 
-       require_once dirname(__FILE__) .'/skipif.inc';
+       require_once(dirname(__FILE__) .'/skipif.inc');
        die("info $HND handler used");
 ?>
 --FILE--
 <?php
-       require_once dirname(__FILE__) .'/test.inc';
+       require_once(dirname(__FILE__) .'/test.inc');
        echo "database handler: $handler\n";
        if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
                dba_insert("key1", "This is a test insert", $db_file);
@@ -19,6 +19,10 @@ DBA Insert/Replace/Fetch Test
                echo "Error creating database\n";
        }
 ?>
+--CLEAN--
+<?php 
+       require(dirname(__FILE__) .'/clean.inc'); 
+?>
 --EXPECTF--
 database handler: %s
 This is the replacement text
index 42da1c64b9cfcd8b4d1e83793af6a71810acb270..6e7180cf6666c4280c56a411363c18cb752d4a0d 100644 (file)
@@ -2,12 +2,12 @@
 DBA Multiple Insert/Fetch Test
 --SKIPIF--
 <?php 
-       require_once dirname(__FILE__) .'/skipif.inc';
+       require_once(dirname(__FILE__) .'/skipif.inc');
        die("info $HND handler used");
 ?>
 --FILE--
 <?php
-       require_once dirname(__FILE__) .'/test.inc';
+       require_once(dirname(__FILE__) .'/test.inc');
        echo "database handler: $handler\n";
        if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
                dba_insert("key1", "Content String 1", $db_file);
@@ -23,6 +23,10 @@ DBA Multiple Insert/Fetch Test
                echo "Error creating database\n";
        }
 ?>
+--CLEAN--
+<?php 
+       require(dirname(__FILE__) .'/clean.inc'); 
+?>
 --EXPECTF--
 database handler: %s
 Another Content String Content String 2
index 3e7e58086e64ced28f22c952cce9cb02cfdc5625..68ad6002207e891abb1c3a392e2ea9f7570dc371 100644 (file)
@@ -2,12 +2,12 @@
 DBA FirstKey/NextKey Loop Test With 5 Items
 --SKIPIF--
 <?php 
-       require_once dirname(__FILE__) .'/skipif.inc';
+       require_once(dirname(__FILE__) .'/skipif.inc');
        die("info $HND handler used");
 ?>
 --FILE--
 <?php
-       require_once dirname(__FILE__) .'/test.inc';
+       require_once(dirname(__FILE__) .'/test.inc');
        echo "database handler: $handler\n";
        if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
                dba_insert("key1", "Content String 1", $db_file);
@@ -30,6 +30,10 @@ DBA FirstKey/NextKey Loop Test With 5 Items
                echo "Error creating database\n";
        }
 ?>
+--CLEAN--
+<?php 
+       require(dirname(__FILE__) .'/clean.inc'); 
+?>
 --EXPECTF--
 database handler: %s
 5YYYYY
index f6177b0b9c3fbf8548d89daad4120ed8b68614b8..a3fc738fac0146bf8cf7a4bea0ff7886db5fc81a 100644 (file)
@@ -2,12 +2,12 @@
 DBA FirstKey/NextKey with 2 deletes
 --SKIPIF--
 <?php 
-       require_once dirname(__FILE__) .'/skipif.inc';
+       require_once(dirname(__FILE__) .'/skipif.inc');
        die("info $HND handler used");
 ?>
 --FILE--
 <?php
-       require_once dirname(__FILE__) .'/test.inc';
+       require_once(dirname(__FILE__) .'/test.inc');
        echo "database handler: $handler\n";
        if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
                dba_insert("key1", "Content String 1", $db_file);
@@ -32,6 +32,10 @@ DBA FirstKey/NextKey with 2 deletes
                echo "Error creating database\n";
        }
 ?>
+--CLEAN--
+<?php 
+       require(dirname(__FILE__) .'/clean.inc'); 
+?>
 --EXPECTF--
 database handler: %s
 3NYNYY
index d332b5b4aee95732b2d77c339bb8525a142a039a..2519fdc59749d7bf29ade1a07cd8ab8295567c21 100644 (file)
@@ -2,16 +2,16 @@
 DBA Multiple File Creation Test
 --SKIPIF--
 <?php 
-       require_once dirname(__FILE__) .'/skipif.inc';
+       require_once(dirname(__FILE__) .'/skipif.inc');
        if (!function_exists('dba_list')) die('skip dba_list() not available');
        die("info $HND handler used");
 ?>
 --FILE--
 <?php
-       require_once dirname(__FILE__) .'/test.inc';
+       require_once(dirname(__FILE__) .'/test.inc');
        echo "database handler: $handler\n";
-       $db_file1 = dirname(__FILE__).'/test1.dbm'; 
-       $db_file2 = dirname(__FILE__).'/test2.dbm'; 
+       $db_file1 = $db_filename1 = dirname(__FILE__).'/test1.dbm'; 
+       $db_file2 = $db_filename2 = dirname(__FILE__).'/test2.dbm'; 
        if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
        echo "database file created\n";
        } else {
@@ -29,6 +29,13 @@ DBA Multiple File Creation Test
     }
        var_dump(dba_list());
        dba_close($db_file);
+
+       @unlink($db_filename1);
+       @unlink($db_filename2);
+?>
+--CLEAN--
+<?php 
+       require(dirname(__FILE__) .'/clean.inc'); 
 ?>
 --EXPECTF--
 database handler: %s
@@ -37,9 +44,9 @@ database file created
 database file created
 array(3) {
   [%d]=>
-  string(%d) "%s/dba/tests/test0.dbm"
+  string(%d) "%stest0.dbm"
   [%d]=>
-  string(%d) "%s/dba/tests/test1.dbm"
+  string(%d) "%stest1.dbm"
   [%d]=>
-  string(%d) "%s/dba/tests/test2.dbm"
+  string(%d) "%stest2.dbm"
 }
index 3863cc5a629c2cb9a1e2be1c063c801c734ace0a..f7015d921f20a9be4697dc1076830935c790f031 100644 (file)
@@ -3,12 +3,12 @@ DBA magic_quotes_runtime Test
 --SKIPIF--
 <?php 
        die('skip, magic_quotes removed');
-       require_once dirname(__FILE__) .'/skipif.inc';
+       require_once(dirname(__FILE__) .'/skipif.inc');
        die("info $HND handler used");
 ?>
 --FILE--
 <?php
-       require_once dirname(__FILE__) .'/test.inc';
+       require_once(dirname(__FILE__) .'/test.inc');
        echo "database handler: $handler\n";
        if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
                ini_set('magic_quotes_runtime', 0);
@@ -25,6 +25,10 @@ DBA magic_quotes_runtime Test
                echo "Error creating database\n";
        }
 ?>
+--CLEAN--
+<?php 
+       require(dirname(__FILE__) .'/clean.inc'); 
+?>
 --EXPECTF--
 database handler: %s
 string(1) """
index b4d8308e89794ed40d17e6e727798c259de4313c..698657b2a38cd826d57f901b1d5fe53346efe3bf 100755 (executable)
@@ -2,12 +2,12 @@
 DBA dba_popen Test
 --SKIPIF--
 <?php 
-       require_once dirname(__FILE__) .'/skipif.inc';
+       require_once(dirname(__FILE__) .'/skipif.inc');
        print("info $HND handler used");
 ?>
 --FILE--
 <?php
-       require_once dirname(__FILE__) .'/test.inc';
+       require_once(dirname(__FILE__) .'/test.inc');
        echo "database handler: $handler\n";
        if (($db=dba_popen($db_file, "n", $handler))!==FALSE) {
                echo "Opened\n";
@@ -24,6 +24,10 @@ DBA dba_popen Test
                echo dba_fetch("a", $db)."\n";
        }
 ?>
+--CLEAN--
+<?php 
+       require(dirname(__FILE__) .'/clean.inc'); 
+?>
 --EXPECTF--
 database handler: %s
 Opened
index 0a6e545ba72b9e9f4f7039e413de45411e81236a..c818373f1f016d030b0282f70aee6e76cdd0b02a 100644 (file)
@@ -2,7 +2,7 @@
 DBA with array keys
 --SKIPIF--
 <?php 
-       require_once dirname(__FILE__) .'/skipif.inc';
+       require_once(dirname(__FILE__) .'/skipif.inc');
        die("info $HND handler used");
 ?>
 --FILE--
@@ -28,14 +28,17 @@ if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
         echo dba_exists("[key$i]name$i", $db_file) ? "Y" : "N";
     }
     echo dba_exists(array("key5","name5"), $db_file) ? "Y" : "N";
+    echo "\n";
     dba_close($db_file);
 } else {
     echo "Error creating database\n";
 }
 
-require_once(dirname(__FILE__) .'/clean.inc');
-
+?>
+--CLEAN--
+<?php 
+       require(dirname(__FILE__) .'/clean.inc'); 
 ?>
 --EXPECTF--
 database handler: %s
-6YYYYYY
\ No newline at end of file
+6YYYYYY
index 792fbbfc44088cfce026210ba328c58cc720c6ba..0984b8aceafac4f0f4e89bd9b601e3588bd2404e 100644 (file)
@@ -3,16 +3,22 @@ DBA CDB handler test
 --SKIPIF--
 <?php 
        $handler = 'cdb';
-       require_once dirname(__FILE__) .'/skipif.inc';
+       require_once(dirname(__FILE__) .'/skipif.inc');
        die('info CDB does not support replace or delete');
 ?>
 --FILE--
 <?php
        $handler = 'cdb';
-       require_once dirname(__FILE__) .'/test.inc';
-       require_once dirname(__FILE__) .'/dba_handler.inc';
+       require_once(dirname(__FILE__) .'/test.inc');
+       require_once(dirname(__FILE__) .'/dba_handler.inc');
 ?>
 ===DONE===
+--CLEAN--
+<?php 
+       require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--XFAIL--
+Unicode status incomplete
 --EXPECT--
 database handler: cdb
 5YYYYY
index 3a025951736446690d8f383ecd9e6f0d445c6293..3980fbbda27d0cc017677cbf7aeaccf526a0d546 100644 (file)
@@ -3,13 +3,13 @@ DBA CDB_MAKE handler test
 --SKIPIF--
 <?php 
        $handler = 'cdb_make';
-       require_once dirname(__FILE__) .'/skipif.inc';
+       require_once(dirname(__FILE__) .'/skipif.inc');
        die('info CDB_MAKE does not support reading');
 ?>
 --FILE--
 <?php
        $handler = 'cdb_make';
-       require_once dirname(__FILE__) .'/test.inc';
+       require_once(dirname(__FILE__) .'/test.inc');
        echo "database handler: $handler\n";
        // print md5 checksum of test.cdb which is generated by cdb_make program
        var_dump(md5_file(dirname(__FILE__).'/test.cdb'));
@@ -30,6 +30,10 @@ DBA CDB_MAKE handler test
                echo "Error creating database\n";
        }
 ?>
+--CLEAN--
+<?php 
+       require(dirname(__FILE__) .'/clean.inc'); 
+?>
 --EXPECT--
 database handler: cdb_make
 unicode(32) "12fc5ba2b9dcfef2480e5324eeb5f3e5"
similarity index 74%
rename from ext/dba/tests/dba_db4.phpt
rename to ext/dba/tests/dba_db4_000.phpt
index 2c2a7a694555ca52d9faa675f56cf8e2492747fe..bbbc52c9f18c1e755a523f031d746e7f4bf6fda0 100644 (file)
@@ -2,16 +2,20 @@
 DBA DB4 handler test
 --SKIPIF--
 <?php 
-       $handler = 'db4';
-       require_once dirname(__FILE__) .'/skipif.inc';
+$handler = 'db4';
+require_once(dirname(__FILE__) .'/skipif.inc');
 ?>
 --FILE--
 <?php
-       $handler = 'db4';
-       require_once dirname(__FILE__) .'/test.inc';
-       require_once dirname(__FILE__) .'/dba_handler.inc';
+$handler = 'db4';
+require_once(dirname(__FILE__) .'/test.inc');
+require_once(dirname(__FILE__) .'/dba_handler.inc');
 ?>
 ===DONE===
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
 --EXPECT--
 database handler: db4
 3NYNYY
diff --git a/ext/dba/tests/dba_db4_001.phpt b/ext/dba/tests/dba_db4_001.phpt
new file mode 100644 (file)
index 0000000..ecc8389
--- /dev/null
@@ -0,0 +1,32 @@
+--TEST--
+DBA DB4 New File Creation open("c") & Insert Test
+--SKIPIF--
+<?php 
+$handler = "db4";
+require_once(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+
+$handler = "db4";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+if (($db_file = dba_open($db_filename, "c", $handler)) !== FALSE) {
+    echo "database file created\n";
+    dba_insert("key1", "This is a test insert", $db_file);
+    echo dba_fetch("key1", $db_file), "\n";
+    dba_close($db_file);
+} else {
+    echo "Error creating $db_filename\n";
+}
+
+?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--EXPECTF--
+database handler: db4
+database file created
+This is a test insert
diff --git a/ext/dba/tests/dba_db4_002.phpt b/ext/dba/tests/dba_db4_002.phpt
new file mode 100644 (file)
index 0000000..18ac0ec
--- /dev/null
@@ -0,0 +1,32 @@
+--TEST--
+DBA DB4 New File Creation open("n") & Insert Test
+--SKIPIF--
+<?php 
+$handler = "db4";
+require_once(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+
+$handler = "db4";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+if (($db_file = dba_open($db_filename, "n", $handler)) !== FALSE) {
+    echo "database file created\n";
+    dba_insert("key1", "This is a test insert", $db_file);
+    echo dba_fetch("key1", $db_file), "\n";
+    dba_close($db_file);
+} else {
+    echo "Error creating $db_filename\n";
+}
+
+?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--EXPECTF--
+database handler: db4
+database file created
+This is a test insert
diff --git a/ext/dba/tests/dba_db4_003.phpt b/ext/dba/tests/dba_db4_003.phpt
new file mode 100644 (file)
index 0000000..084bff8
--- /dev/null
@@ -0,0 +1,41 @@
+--TEST--
+DBA DB4 File Creation open("c") with existing file
+--SKIPIF--
+<?php 
+$handler = "db4";
+require_once(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+
+$handler = "db4";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+
+var_dump(file_put_contents($db_filename, "Dummy contents"));
+
+if (($db_file = dba_open($db_filename, "c", $handler)) !== FALSE) {
+    if (file_exists($db_filename)) {
+        echo "database file created\n";
+        dba_close($db_file);
+    } else {
+        echo "File did not get created\n";
+    }
+} else {
+    echo "Error creating $db_filename\n";
+}
+
+?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--EXPECTF--
+database handler: db4
+int(14)
+
+Notice: dba_open(): %stest0.dbm: unexpected file type or format in %sdba_db4_003.php on line %d
+
+Warning: dba_open(%stest0.dbm,c): Driver initialization failed for handler: db4: Invalid argument in %sdba_db4_003.php on line %d
+Error creating %stest0.dbm
diff --git a/ext/dba/tests/dba_db4_004.phpt b/ext/dba/tests/dba_db4_004.phpt
new file mode 100644 (file)
index 0000000..ca876f8
--- /dev/null
@@ -0,0 +1,40 @@
+--TEST--
+DBA DB4 Truncate Existing File open("n")
+--SKIPIF--
+<?php 
+$handler = "db4";
+require_once(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+
+$handler = "db4";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+
+var_dump(file_put_contents($db_filename, "Dummy contents"));
+
+if (($db_file = dba_open($db_filename, "n", $handler)) !== FALSE) {
+    if (file_exists($db_filename)) {
+        echo "database file created\n";
+        dba_insert("key1", "This is a test insert", $db_file);
+        echo dba_fetch("key1", $db_file), "\n";
+        dba_close($db_file);
+    } else {
+        echo "File did not get created\n";
+    }
+} else {
+    echo "Error creating $db_filename\n";
+}
+
+?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--EXPECTF--
+database handler: db4
+int(14)
+database file created
+This is a test insert
diff --git a/ext/dba/tests/dba_db4_005.phpt b/ext/dba/tests/dba_db4_005.phpt
new file mode 100644 (file)
index 0000000..54bb475
--- /dev/null
@@ -0,0 +1,32 @@
+--TEST--
+DBA DB4 New File Creation popen("c") & Insert Test
+--SKIPIF--
+<?php 
+$handler = "db4";
+require_once(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+
+$handler = "db4";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
+    echo "database file created\n";
+    dba_insert("key1", "This is a test insert", $db_file);
+    echo dba_fetch("key1", $db_file), "\n";
+    dba_close($db_file);
+} else {
+    echo "Error creating $db_filename\n";
+}
+
+?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--EXPECTF--
+database handler: db4
+database file created
+This is a test insert
diff --git a/ext/dba/tests/dba_db4_006.phpt b/ext/dba/tests/dba_db4_006.phpt
new file mode 100644 (file)
index 0000000..7d95385
--- /dev/null
@@ -0,0 +1,32 @@
+--TEST--
+DBA DB4 New File Creation popen("n") & Insert Test
+--SKIPIF--
+<?php 
+$handler = "db4";
+require_once(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+
+$handler = "db4";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+if (($db_file = dba_popen($db_filename, "n", $handler)) !== FALSE) {
+    echo "database file created\n";
+    dba_insert("key1", "This is a test insert", $db_file);
+    echo dba_fetch("key1", $db_file), "\n";
+    dba_close($db_file);
+} else {
+    echo "Error creating $db_filename\n";
+}
+
+?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--EXPECTF--
+database handler: db4
+database file created
+This is a test insert
diff --git a/ext/dba/tests/dba_db4_007.phpt b/ext/dba/tests/dba_db4_007.phpt
new file mode 100644 (file)
index 0000000..bd95e0b
--- /dev/null
@@ -0,0 +1,41 @@
+--TEST--
+DBA DB4 File Creation popen("c") with existing invalid file
+--SKIPIF--
+<?php 
+$handler = "db4";
+require_once(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+
+$handler = "db4";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+
+var_dump(file_put_contents($db_filename, "Dummy contents"));
+
+if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
+    if (file_exists($db_filename)) {
+        echo "database file created\n";
+        dba_close($db_file);
+    } else {
+        echo "File did not get created\n";
+    }
+} else {
+    echo "Error creating $db_filename\n";
+}
+
+?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--EXPECTF--
+database handler: db4
+int(14)
+
+Notice: dba_popen(): %stest0.dbm: unexpected file type or format in %sdba_db4_007.php on line %d
+
+Warning: dba_popen(%stest0.dbm,c): Driver initialization failed for handler: db4: Invalid argument in %sdba_db4_007.php on line %d
+Error creating %stest0.dbm
diff --git a/ext/dba/tests/dba_db4_008.phpt b/ext/dba/tests/dba_db4_008.phpt
new file mode 100644 (file)
index 0000000..80f62ea
--- /dev/null
@@ -0,0 +1,40 @@
+--TEST--
+DBA DB4 Truncate Existing File popen("n")
+--SKIPIF--
+<?php 
+$handler = "db4";
+require_once(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+
+$handler = "db4";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+
+var_dump(file_put_contents($db_filename, "Dummy contents"));
+
+if (($db_file = dba_popen($db_filename, "n", $handler)) !== FALSE) {
+    if (file_exists($db_filename)) {
+        echo "database file created\n";
+        dba_insert("key1", "This is a test insert", $db_file);
+        echo dba_fetch("key1", $db_file), "\n";
+        dba_close($db_file);
+    } else {
+        echo "File did not get created\n";
+    }
+} else {
+    echo "Error creating $db_filename\n";
+}
+
+?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--EXPECTF--
+database handler: db4
+int(14)
+database file created
+This is a test insert
diff --git a/ext/dba/tests/dba_db4_009.phpt b/ext/dba/tests/dba_db4_009.phpt
new file mode 100644 (file)
index 0000000..5a870c9
--- /dev/null
@@ -0,0 +1,53 @@
+--TEST--
+DBA DB4 Multiple File Creation Test
+--SKIPIF--
+<?php 
+$handler = "db4";
+require_once(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+$handler = "db4";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+$db_file1 = $db_filename1 = dirname(__FILE__).'/test1.dbm'; 
+$db_file2 = $db_filename2 = dirname(__FILE__).'/test2.dbm'; 
+if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
+    echo "database file created\n";
+} else {
+    echo "$db_file does not exist\n";
+}
+if (($db_file1=dba_open($db_file1, "n", $handler))!==FALSE) {
+    echo "database file created\n";
+} else {
+    echo "$db_file does not exist\n";
+}
+if (($db_file2=dba_open($db_file2, "n", $handler))!==FALSE) {
+    echo "database file created\n";
+} else {
+    echo "$db_file does not exist\n";
+}
+var_dump(dba_list());
+dba_close($db_file);
+
+@unlink($db_filename1);
+@unlink($db_filename2);
+?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--EXPECTF--
+database handler: db4
+database file created
+database file created
+database file created
+array(3) {
+  [%d]=>
+  string(%d) "%stest0.dbm"
+  [%d]=>
+  string(%d) "%stest1.dbm"
+  [%d]=>
+  string(%d) "%stest2.dbm"
+}
diff --git a/ext/dba/tests/dba_db4_010.phpt b/ext/dba/tests/dba_db4_010.phpt
new file mode 100644 (file)
index 0000000..118b7dd
--- /dev/null
@@ -0,0 +1,31 @@
+--TEST--
+DBA DB4 Quote Test
+--SKIPIF--
+<?php 
+$handler = "db4";
+require_once(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+$handler = "db4";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
+    dba_insert("key1", '"', $db_file);
+    var_dump(dba_fetch("key1", $db_file));
+    dba_replace("key1", '\"', $db_file);
+    var_dump(dba_fetch("key1", $db_file));
+    dba_close($db_file);
+} else {
+    echo "Error creating database\n";
+}
+?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--EXPECTF--
+database handler: db4
+string(1) """
+string(2) "\""
diff --git a/ext/dba/tests/dba_db4_011.phpt b/ext/dba/tests/dba_db4_011.phpt
new file mode 100644 (file)
index 0000000..ce9be27
--- /dev/null
@@ -0,0 +1,36 @@
+--TEST--
+DBA DB4 with repeated key
+--SKIPIF--
+<?php 
+$handler = "db4";
+require_once(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+$handler = "db4";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+if (($db_file=dba_open($db_filename, "c", $handler))!==FALSE) {
+    var_dump(dba_insert("key1", "Content String 1", $db_file));
+    var_dump(dba_insert("key2", "Content String 2", $db_file));
+    var_dump(dba_insert("key2", "Same key", $db_file));
+    echo dba_fetch("key1", $db_file), "\n";
+    echo dba_fetch("key2", $db_file), "\n";
+    dba_close($db_file);
+} else {
+    echo "Error creating database\n";
+}
+
+?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--EXPECTF--
+database handler: db4
+bool(true)
+bool(true)
+bool(false)
+Content String 1
+Content String 2
diff --git a/ext/dba/tests/dba_db4_012.phpt b/ext/dba/tests/dba_db4_012.phpt
new file mode 100644 (file)
index 0000000..2caa43c
--- /dev/null
@@ -0,0 +1,31 @@
+--TEST--
+DBA DB4 New File Creation open("rl")
+--SKIPIF--
+<?php 
+$handler = "db4";
+require_once(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+
+$handler = "db4";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+if (($db_file = dba_open($db_filename, "rl", $handler)) !== FALSE) {
+    echo "database file created\n";
+    dba_close($db_file);
+} else {
+    echo "Error creating $db_filename\n";
+}
+
+?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--EXPECTF--
+database handler: db4
+
+Warning: dba_open(%stest0.dbm,rl): Driver initialization failed for handler: db4: No such file or directory in %sdba_db4_012.php on line %d
+Error creating %stest0.dbm
diff --git a/ext/dba/tests/dba_db4_013.phpt b/ext/dba/tests/dba_db4_013.phpt
new file mode 100644 (file)
index 0000000..ba2d171
--- /dev/null
@@ -0,0 +1,40 @@
+--TEST--
+DBA DB4 File open("rl") & Insert Test
+--SKIPIF--
+<?php 
+$handler = "db4";
+require_once(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+
+$handler = "db4";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+
+if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
+    echo "database file created\n";
+    dba_close($db_file);
+}
+
+if (($db_file = dba_popen($db_filename, "rl", $handler)) !== FALSE) {
+    echo "database file opened\n";
+    dba_insert("key1", "This is a test insert", $db_file);
+    echo dba_fetch("key1", $db_file), "\n";
+    dba_close($db_file);
+} else {
+    echo "Error creating $db_filename\n";
+}
+
+?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--EXPECTF--
+database handler: db4
+database file created
+database file opened
+
+Warning: dba_insert(): You cannot perform a modification to a database without proper access in %sdba_db4_013.php on line %d
diff --git a/ext/dba/tests/dba_db4_014.phpt b/ext/dba/tests/dba_db4_014.phpt
new file mode 100644 (file)
index 0000000..6fb22f8
--- /dev/null
@@ -0,0 +1,32 @@
+--TEST--
+DBA DB4 File open("wl") & Insert Test
+--SKIPIF--
+<?php 
+$handler = "db4";
+require_once(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+
+$handler = "db4";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+
+if (($db_file = dba_open($db_filename, "wl", $handler)) !== FALSE) {
+    echo "database file opened\n";
+    dba_close($db_file);
+} else {
+    echo "Error creating $db_filename\n";
+}
+
+?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--EXPECTF--
+database handler: db4
+
+Warning: dba_open(%stest0.dbm,wl): Driver initialization failed for handler: db4: No such file or directory in %sdba_db4_014.php on line %d
+Error creating %stest0.dbm
diff --git a/ext/dba/tests/dba_db4_015.phpt b/ext/dba/tests/dba_db4_015.phpt
new file mode 100644 (file)
index 0000000..a153567
--- /dev/null
@@ -0,0 +1,39 @@
+--TEST--
+DBA DB4 File open("wl") & Insert Test
+--SKIPIF--
+<?php 
+$handler = "db4";
+require_once(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+
+$handler = "db4";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+
+if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
+    echo "database file created\n";
+    dba_close($db_file);
+}
+
+if (($db_file = dba_popen($db_filename, "wl", $handler)) !== FALSE) {
+    echo "database file opened\n";
+    dba_insert("key1", "This is a test insert", $db_file);
+    echo dba_fetch("key1", $db_file), "\n";
+    dba_close($db_file);
+} else {
+    echo "Error creating $db_filename\n";
+}
+
+?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--EXPECTF--
+database handler: db4
+database file created
+database file opened
+This is a test insert
diff --git a/ext/dba/tests/dba_db4_016.phpt b/ext/dba/tests/dba_db4_016.phpt
new file mode 100644 (file)
index 0000000..b79cc71
--- /dev/null
@@ -0,0 +1,59 @@
+--TEST--
+DBA DB4 File Creation popen("c") with existing valid file
+--SKIPIF--
+<?php 
+$handler = "db4";
+require_once(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+
+$handler = "db4";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+
+if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
+    if (file_exists($db_filename)) {
+        echo "database file created\n";
+        var_dump(dba_insert("key1", "This is a test insert", $db_file));
+        echo dba_fetch("key1", $db_file), "\n";
+        dba_close($db_file);
+    } else {
+        echo "File did not get created\n";
+    }
+} else {
+    echo "Error creating $db_filename\n";
+}
+
+// Now test reopening it
+if (($db_file = dba_popen($db_filename, "c", $handler)) !== FALSE) {
+    if (file_exists($db_filename)) {
+        echo "database file created\n";
+        var_dump(dba_insert("key1", "second open test", $db_file));
+        var_dump(dba_insert("key2", "second open test row 2", $db_file));
+        echo dba_fetch("key1", $db_file), "\n";
+        echo dba_fetch("key2", $db_file), "\n";
+        dba_close($db_file);
+    } else {
+        echo "File did not get created\n";
+    }
+} else {
+    echo "Error creating $db_filename\n";
+}
+
+?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--EXPECTF--
+database handler: db4
+database file created
+bool(true)
+This is a test insert
+database file created
+bool(false)
+bool(true)
+This is a test insert
+second open test row 2
diff --git a/ext/dba/tests/dba_db4_handlers.phpt b/ext/dba/tests/dba_db4_handlers.phpt
new file mode 100644 (file)
index 0000000..8a50406
--- /dev/null
@@ -0,0 +1,52 @@
+--TEST--
+DBA DB4 Handler Test
+--SKIPIF--
+<?php 
+$handler="db4";
+require(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+$handler="db4";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+
+function check($h)
+{
+    if (!$h) {
+        return;
+    }
+
+    foreach ($h as $key) {
+        if ($key === "db4") {
+            echo "Success: db4 enabled\n";
+        }
+    }
+}
+
+echo "Test 1\n";
+
+check(dba_handlers());
+
+echo "Test 2 - full info\n";
+$h = dba_handlers(1);
+foreach ($h as $key => $val) {
+    if ($key === "db4") {
+        echo "$val\n";
+    }
+}
+
+?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--XFAIL--
+Memory leak in this branch only
+--EXPECTF--
+database handler: db4
+Test 1
+Success: db4 enabled
+Test 2 - full info
+Berkeley DB 4.%s
diff --git a/ext/dba/tests/dba_db4_optimize.phpt b/ext/dba/tests/dba_db4_optimize.phpt
new file mode 100644 (file)
index 0000000..de27dd8
--- /dev/null
@@ -0,0 +1,38 @@
+--TEST--
+DBA DB4 Optimize Test
+--SKIPIF--
+<?php
+$handler = "db4";
+require_once(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+$handler = "db4";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
+    dba_insert("key1", "Content String 1", $db_file);
+    dba_insert("key2", "Content String 2", $db_file);
+    for ($i=1; $i<3; $i++) {
+        echo dba_exists("key$i", $db_file) ? "Y" : "N";
+    }
+    echo "\n";
+    var_dump(dba_optimize($db_file));
+    dba_close($db_file);
+} else {
+    echo "Error creating database\n";
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--EXPECTF--
+database handler: db4
+YY
+bool(true)
+===DONE===
diff --git a/ext/dba/tests/dba_db4_sync.phpt b/ext/dba/tests/dba_db4_sync.phpt
new file mode 100644 (file)
index 0000000..8c4e248
--- /dev/null
@@ -0,0 +1,38 @@
+--TEST--
+DBA DB4 Sync Test
+--SKIPIF--
+<?php
+$handler = "db4";
+require_once(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+$handler = "db4";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
+    dba_insert("key1", "Content String 1", $db_file);
+    dba_insert("key2", "Content String 2", $db_file);
+    for ($i=1; $i<3; $i++) {
+        echo dba_exists("key$i", $db_file) ? "Y" : "N";
+    }
+    echo "\n";
+    var_dump(dba_sync($db_file));
+    dba_close($db_file);
+} else {
+    echo "Error creating database\n";
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--EXPECTF--
+database handler: db4
+YY
+bool(true)
+===DONE===
index 30005cd78e15f73e04d75937ec8a6613d557c188..126fb173162ba4c5ecdf2c11dbed2e1e7c4db66e 100644 (file)
@@ -3,15 +3,21 @@ DBA FlatFile handler test
 --SKIPIF--
 <?php 
        $handler = 'flatfile';
-       require_once dirname(__FILE__) .'/skipif.inc';
+       require_once(dirname(__FILE__) .'/skipif.inc');
 ?>
 --FILE--
 <?php
        $handler = 'flatfile';
-       require_once dirname(__FILE__) .'/test.inc';
-       require_once dirname(__FILE__) .'/dba_handler.inc';
+       require_once(dirname(__FILE__) .'/test.inc');
+       require_once(dirname(__FILE__) .'/dba_handler.inc');
 ?>
 ===DONE===
+--CLEAN--
+<?php 
+       require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--XFAIL--
+Unicode status incomplete
 --EXPECT--
 database handler: flatfile
 3NYNYY
diff --git a/ext/dba/tests/dba_handlers.phpt b/ext/dba/tests/dba_handlers.phpt
new file mode 100644 (file)
index 0000000..ead1f4c
--- /dev/null
@@ -0,0 +1,71 @@
+--TEST--
+DBA Handler Test
+--SKIPIF--
+<?php 
+$handler="flatfile";
+require(dirname(__FILE__) .'/skipif.inc');
+die("info $HND handler used");
+?>
+--FILE--
+<?php
+$handler="flatfile";
+require_once(dirname(__FILE__) .'/test.inc');
+echo "database handler: $handler\n";
+
+function check($h)
+{
+    if (!$h) {
+        return;
+    }
+
+    foreach ($h as $key) {
+        if ($key === "flatfile") {
+            echo "Success: flatfile enabled\n";
+        }
+    }
+}
+
+echo "Test 1\n";
+
+check(dba_handlers());
+
+echo "Test 2\n";
+
+check(dba_handlers(null));
+
+echo "Test 3\n";
+
+check(dba_handlers(1, 2));
+
+echo "Test 4\n";
+
+check(dba_handlers(0));
+
+echo "Test 5 - full info\n";
+$h = dba_handlers(1);
+foreach ($h as $key => $val) {
+    if ($key === "flatfile") {
+        echo "Success: flatfile enabled\n";
+    }
+}
+
+?>
+--CLEAN--
+<?php 
+require(dirname(__FILE__) .'/clean.inc'); 
+?>
+--XFAIL--
+Memory leak in this branch only
+--EXPECTF--
+database handler: flatfile
+Test 1
+Success: flatfile enabled
+Test 2
+Success: flatfile enabled
+Test 3
+
+Warning: dba_handlers() expects at most 1 parameter, 2 given in %sdba_handlers.php on line %d
+Test 4
+Success: flatfile enabled
+Test 5 - full info
+Success: flatfile enabled
index 2fd850452581434334caf4c28e06e175b1891e21..fbb395756f0c1444608061027376228a5e94b233 100644 (file)
@@ -1,6 +1,10 @@
 --TEST--
 DBA Optimize Test
 --SKIPIF--
+<?php
+       require_once dirname(__FILE__) .'/skipif.inc';
+       die("info $HND handler used");
+?>
 --FILE--
 <?php
 require_once(dirname(__FILE__) .'/test.inc');
@@ -27,11 +31,13 @@ if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
     echo "Error creating database\n";
 }
 
-require_once(dirname(__FILE__) .'/clean.inc');
-
 ?>
 ===DONE===
 <?php exit(0); ?>
+--CLEAN--
+<?php 
+       require(dirname(__FILE__) .'/clean.inc'); 
+?>
 --EXPECTF--
 database handler: flatfile
 2YY
index e09896aacca1583209d39a809341890624eff8f6..dbb949e8c7ab0963f5afb7e7b3a43728bf495cc8 100644 (file)
@@ -1,6 +1,10 @@
 --TEST--
 DBA Sync Test
 --SKIPIF--
+<?php
+       require_once dirname(__FILE__) .'/skipif.inc';
+       die("info $HND handler used");
+?>
 --FILE--
 <?php
 require_once(dirname(__FILE__) .'/test.inc');
@@ -27,11 +31,13 @@ if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
     echo "Error creating database\n";
 }
 
-require_once(dirname(__FILE__) .'/clean.inc');
-
 ?>
 ===DONE===
 <?php exit(0); ?>
+--CLEAN--
+<?php 
+       require(dirname(__FILE__) .'/clean.inc'); 
+?>
 --EXPECTF--
 database handler: flatfile
 2YY