Browse Source

Improve dba tests: check in both modes external and database locking.

PEAR_1_4DEV
Marcus Boerger 22 years ago
parent
commit
a6dd097484
  1. 17
      ext/dba/tests/dba_cdb.phpt
  2. 19
      ext/dba/tests/dba_db2.phpt
  3. 19
      ext/dba/tests/dba_db3.phpt
  4. 17
      ext/dba/tests/dba_db4.phpt
  5. 17
      ext/dba/tests/dba_dbm.phpt
  6. 19
      ext/dba/tests/dba_flatfile.phpt
  7. 4
      ext/dba/tests/dba_gdbm.phpt
  8. 16
      ext/dba/tests/dba_handler.inc
  9. 19
      ext/dba/tests/dba_inifile.phpt
  10. 19
      ext/dba/tests/dba_ndbm.phpt

17
ext/dba/tests/dba_cdb.phpt

@ -12,6 +12,7 @@ DBA CDB handler test
require_once('test.inc');
require_once('dba_handler.inc');
?>
===DONE===
--EXPECT--
database handler: cdb
5YYYYY
@ -28,3 +29,19 @@ array(5) {
["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===

19
ext/dba/tests/dba_db2.phpt

@ -11,6 +11,7 @@ DBA DB2 handler test
require_once('test.inc');
require_once('dba_handler.inc');
?>
===DONE===
--EXPECT--
database handler: db2
3NYNYY
@ -26,4 +27,20 @@ array(3) {
string(27) "Content 2 replaced 2nd time"
["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===

19
ext/dba/tests/dba_db3.phpt

@ -11,6 +11,7 @@ DBA DB3 handler test
require_once('test.inc');
require_once('dba_handler.inc');
?>
===DONE===
--EXPECT--
database handler: db3
3NYNYY
@ -26,4 +27,20 @@ array(3) {
string(27) "Content 2 replaced 2nd time"
["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===

17
ext/dba/tests/dba_db4.phpt

@ -11,6 +11,7 @@ DBA DB4 handler test
require_once('test.inc');
require_once('dba_handler.inc');
?>
===DONE===
--EXPECT--
database handler: db4
3NYNYY
@ -27,3 +28,19 @@ array(3) {
["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===

17
ext/dba/tests/dba_dbm.phpt

@ -11,6 +11,7 @@ DBA DBM handler test
require_once('test.inc');
require_once('dba_handler.inc');
?>
===DONE===
--EXPECT--
database handler: dbm
3NYNYY
@ -27,3 +28,19 @@ array(3) {
["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===

19
ext/dba/tests/dba_flatfile.phpt

@ -11,6 +11,7 @@ DBA FlatFile handler test
require_once('test.inc');
require_once('dba_handler.inc');
?>
===DONE===
--EXPECT--
database handler: flatfile
3NYNYY
@ -26,4 +27,20 @@ array(3) {
string(27) "Content 2 replaced 2nd time"
["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===

4
ext/dba/tests/dba_gdbm.phpt

@ -14,6 +14,7 @@ DBA GDBM handler test
// Read during write is system dependant. Important is that there is no deadlock
?>
===DONE===
--EXPECTF--
database handler: gdbm
3NYNYY
@ -29,4 +30,5 @@ array(3) {
string(27) "Content 2 replaced 2nd time"
["key5"]=>
string(23) "The last content string"
}
}
===DONE===

16
ext/dba/tests/dba_handler.inc

@ -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);
?>

19
ext/dba/tests/dba_inifile.phpt

@ -11,6 +11,7 @@ DBA INIFILE handler test
require_once('test.inc');
require_once('dba_handler.inc');
?>
===DONE===
--EXPECT--
database handler: inifile
3NYNYY
@ -26,4 +27,20 @@ array(3) {
string(27) "Content 2 replaced 2nd time"
["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===

19
ext/dba/tests/dba_ndbm.phpt

@ -11,6 +11,7 @@ DBA NDBM handler test
require_once('test.inc');
require_once('dba_handler.inc');
?>
===DONE===
--EXPECT--
database handler: ndbm
3NYNYY
@ -26,4 +27,20 @@ array(3) {
string(27) "Content 2 replaced 2nd time"
["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===
Loading…
Cancel
Save