helly           Thu Dec 18 15:10:27 2003 EDT

  Modified files:              
    /php-src/ext/dba/tests      dba_cdb.phpt dba_db2.phpt dba_db3.phpt 
                                dba_db4.phpt dba_dbm.phpt dba_flatfile.phpt 
                                dba_gdbm.phpt dba_handler.inc 
                                dba_inifile.phpt dba_ndbm.phpt 
  Log:
  Improve dba tests: check in both modes external and database locking.
  
  
Index: php-src/ext/dba/tests/dba_cdb.phpt
diff -u php-src/ext/dba/tests/dba_cdb.phpt:1.7 php-src/ext/dba/tests/dba_cdb.phpt:1.8
--- php-src/ext/dba/tests/dba_cdb.phpt:1.7      Tue Mar  4 15:31:41 2003
+++ php-src/ext/dba/tests/dba_cdb.phpt  Thu Dec 18 15:10:24 2003
@@ -12,6 +12,7 @@
        require_once('test.inc');
        require_once('dba_handler.inc');
 ?>
+===DONE===
 --EXPECT--
 database handler: cdb
 5YYYYY
@@ -28,3 +29,19 @@
   ["key5"]=>
   string(23) "The last content string"
 }
+--NO-LOCK--
+5YYYYY
+Content String 2
+array(5) {
+  ["key1"]=>
+  string(16) "Content String 1"
+  ["key2"]=>
+  string(16) "Content String 2"
+  ["key3"]=>
+  string(20) "Third Content String"
+  ["key4"]=>
+  string(22) "Another Content String"
+  ["key5"]=>
+  string(23) "The last content string"
+}
+===DONE===
Index: php-src/ext/dba/tests/dba_db2.phpt
diff -u php-src/ext/dba/tests/dba_db2.phpt:1.4 php-src/ext/dba/tests/dba_db2.phpt:1.5
--- php-src/ext/dba/tests/dba_db2.phpt:1.4      Tue Mar  4 15:31:42 2003
+++ php-src/ext/dba/tests/dba_db2.phpt  Thu Dec 18 15:10:24 2003
@@ -11,6 +11,7 @@
        require_once('test.inc');
        require_once('dba_handler.inc');
 ?>
+===DONE===
 --EXPECT--
 database handler: db2
 3NYNYY
@@ -26,4 +27,20 @@
   string(27) "Content 2 replaced 2nd time"
   ["key5"]=>
   string(23) "The last content string"
-}
\ No newline at end of file
+}
+--NO-LOCK--
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+  ["key number 6"]=>
+  string(13) "The 6th value"
+  ["key2"]=>
+  string(27) "Content 2 replaced 2nd time"
+  ["key5"]=>
+  string(23) "The last content string"
+}
+===DONE===
Index: php-src/ext/dba/tests/dba_db3.phpt
diff -u php-src/ext/dba/tests/dba_db3.phpt:1.4 php-src/ext/dba/tests/dba_db3.phpt:1.5
--- php-src/ext/dba/tests/dba_db3.phpt:1.4      Tue Mar  4 15:31:42 2003
+++ php-src/ext/dba/tests/dba_db3.phpt  Thu Dec 18 15:10:24 2003
@@ -11,6 +11,7 @@
        require_once('test.inc');
        require_once('dba_handler.inc');
 ?>
+===DONE===
 --EXPECT--
 database handler: db3
 3NYNYY
@@ -26,4 +27,20 @@
   string(27) "Content 2 replaced 2nd time"
   ["key5"]=>
   string(23) "The last content string"
-}
\ No newline at end of file
+}
+--NO-LOCK--
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+  ["key number 6"]=>
+  string(13) "The 6th value"
+  ["key2"]=>
+  string(27) "Content 2 replaced 2nd time"
+  ["key5"]=>
+  string(23) "The last content string"
+}
+===DONE===
Index: php-src/ext/dba/tests/dba_db4.phpt
diff -u php-src/ext/dba/tests/dba_db4.phpt:1.3 php-src/ext/dba/tests/dba_db4.phpt:1.4
--- php-src/ext/dba/tests/dba_db4.phpt:1.3      Tue Mar  4 15:31:42 2003
+++ php-src/ext/dba/tests/dba_db4.phpt  Thu Dec 18 15:10:24 2003
@@ -11,6 +11,7 @@
        require_once('test.inc');
        require_once('dba_handler.inc');
 ?>
+===DONE===
 --EXPECT--
 database handler: db4
 3NYNYY
@@ -27,3 +28,19 @@
   ["key5"]=>
   string(23) "The last content string"
 }
+--NO-LOCK--
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+  ["key number 6"]=>
+  string(13) "The 6th value"
+  ["key2"]=>
+  string(27) "Content 2 replaced 2nd time"
+  ["key5"]=>
+  string(23) "The last content string"
+}
+===DONE===
Index: php-src/ext/dba/tests/dba_dbm.phpt
diff -u php-src/ext/dba/tests/dba_dbm.phpt:1.4 php-src/ext/dba/tests/dba_dbm.phpt:1.5
--- php-src/ext/dba/tests/dba_dbm.phpt:1.4      Tue Mar  4 15:31:42 2003
+++ php-src/ext/dba/tests/dba_dbm.phpt  Thu Dec 18 15:10:24 2003
@@ -11,6 +11,7 @@
        require_once('test.inc');
        require_once('dba_handler.inc');
 ?>
+===DONE===
 --EXPECT--
 database handler: dbm
 3NYNYY
@@ -27,3 +28,19 @@
   ["key5"]=>
   string(23) "The last content string"
 }
+--NO-LOCK--
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+  ["key number 6"]=>
+  string(13) "The 6th value"
+  ["key2"]=>
+  string(27) "Content 2 replaced 2nd time"
+  ["key5"]=>
+  string(23) "The last content string"
+}
+===DONE===
Index: php-src/ext/dba/tests/dba_flatfile.phpt
diff -u php-src/ext/dba/tests/dba_flatfile.phpt:1.4 
php-src/ext/dba/tests/dba_flatfile.phpt:1.5
--- php-src/ext/dba/tests/dba_flatfile.phpt:1.4 Tue Mar  4 15:31:42 2003
+++ php-src/ext/dba/tests/dba_flatfile.phpt     Thu Dec 18 15:10:24 2003
@@ -11,6 +11,7 @@
        require_once('test.inc');
        require_once('dba_handler.inc');
 ?>
+===DONE===
 --EXPECT--
 database handler: flatfile
 3NYNYY
@@ -26,4 +27,20 @@
   string(27) "Content 2 replaced 2nd time"
   ["key5"]=>
   string(23) "The last content string"
-}
\ No newline at end of file
+}
+--NO-LOCK--
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+  ["key number 6"]=>
+  string(13) "The 6th value"
+  ["key2"]=>
+  string(27) "Content 2 replaced 2nd time"
+  ["key5"]=>
+  string(23) "The last content string"
+}
+===DONE===
Index: php-src/ext/dba/tests/dba_gdbm.phpt
diff -u php-src/ext/dba/tests/dba_gdbm.phpt:1.5 php-src/ext/dba/tests/dba_gdbm.phpt:1.6
--- php-src/ext/dba/tests/dba_gdbm.phpt:1.5     Tue Mar  4 15:31:42 2003
+++ php-src/ext/dba/tests/dba_gdbm.phpt Thu Dec 18 15:10:24 2003
@@ -14,6 +14,7 @@
        
        // Read during write is system dependant. Important is that there is no 
deadlock
 ?>
+===DONE===
 --EXPECTF--
 database handler: gdbm
 3NYNYY
@@ -29,4 +30,5 @@
   string(27) "Content 2 replaced 2nd time"
   ["key5"]=>
   string(23) "The last content string"
-}
\ No newline at end of file
+}
+===DONE===
Index: php-src/ext/dba/tests/dba_handler.inc
diff -u php-src/ext/dba/tests/dba_handler.inc:1.11 
php-src/ext/dba/tests/dba_handler.inc:1.12
--- php-src/ext/dba/tests/dba_handler.inc:1.11  Sun Dec 14 17:09:28 2003
+++ php-src/ext/dba/tests/dba_handler.inc       Thu Dec 18 15:10:24 2003
@@ -1,5 +1,8 @@
 <?php
-       echo "database handler: $handler\n";
+
+echo "database handler: $handler\n";
+
+do {
        if (($db_file = dba_open($db_filename, 'n'.$lock_flag, $handler))!==FALSE) {
                dba_insert("key1", "Content String 1", $db_file);
                dba_insert("key2", "Content String 2", $db_file);
@@ -71,5 +74,14 @@
                dba_close($dba_reader);
        }
        if (($db_file = dba_popen($db_filename, 'r'.($handler!='gdbm'?'-':''), 
$handler))!==FALSE) {
-       }       
+       }
+
+       if ($lock_flag == '') {
+               break;
+       } else {
+               echo "--NO-LOCK--\n";
+               $lock_flag = '';
+       }
+} while(1);
+
 ?>
\ No newline at end of file
Index: php-src/ext/dba/tests/dba_inifile.phpt
diff -u php-src/ext/dba/tests/dba_inifile.phpt:1.2 
php-src/ext/dba/tests/dba_inifile.phpt:1.3
--- php-src/ext/dba/tests/dba_inifile.phpt:1.2  Tue Mar  4 15:31:42 2003
+++ php-src/ext/dba/tests/dba_inifile.phpt      Thu Dec 18 15:10:24 2003
@@ -11,6 +11,7 @@
        require_once('test.inc');
        require_once('dba_handler.inc');
 ?>
+===DONE===
 --EXPECT--
 database handler: inifile
 3NYNYY
@@ -26,4 +27,20 @@
   string(27) "Content 2 replaced 2nd time"
   ["key5"]=>
   string(23) "The last content string"
-}
\ No newline at end of file
+}
+--NO-LOCK--
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+  ["key number 6"]=>
+  string(13) "The 6th value"
+  ["key2"]=>
+  string(27) "Content 2 replaced 2nd time"
+  ["key5"]=>
+  string(23) "The last content string"
+}
+===DONE===
Index: php-src/ext/dba/tests/dba_ndbm.phpt
diff -u php-src/ext/dba/tests/dba_ndbm.phpt:1.4 php-src/ext/dba/tests/dba_ndbm.phpt:1.5
--- php-src/ext/dba/tests/dba_ndbm.phpt:1.4     Tue Mar  4 15:31:42 2003
+++ php-src/ext/dba/tests/dba_ndbm.phpt Thu Dec 18 15:10:24 2003
@@ -11,6 +11,7 @@
        require_once('test.inc');
        require_once('dba_handler.inc');
 ?>
+===DONE===
 --EXPECT--
 database handler: ndbm
 3NYNYY
@@ -26,4 +27,20 @@
   string(27) "Content 2 replaced 2nd time"
   ["key5"]=>
   string(23) "The last content string"
-}
\ No newline at end of file
+}
+--NO-LOCK--
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+  ["key number 6"]=>
+  string(13) "The 6th value"
+  ["key2"]=>
+  string(27) "Content 2 replaced 2nd time"
+  ["key5"]=>
+  string(23) "The last content string"
+}
+===DONE===

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to