Skip to content

Improve DBA test suite #8904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jul 28, 2022
Merged
2 changes: 0 additions & 2 deletions ext/dba/tests/CONFLICTS

This file was deleted.

26 changes: 12 additions & 14 deletions ext/dba/tests/bug36436.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,17 @@ Bug #36436 (DBA problem with Berkeley DB4)
dba
--SKIPIF--
<?php
$handler = 'db4';
require_once(__DIR__ .'/skipif.inc');
require_once __DIR__ . '/setup/setup_dba_tests.inc';
check_skip('db4');
?>
--FILE--
<?php
require_once __DIR__ . '/setup/setup_dba_tests.inc';
$db_name = 'bug36436.db';

$handler = 'db4';
require_once(__DIR__ .'/test.inc');
$db = set_up_db_ex('db4', $db_name, LockFlag::DbLock, persistent: true);

$db = dba_popen($db_filename, 'c', 'db4');

dba_insert('X', 'XYZ', $db);
dba_insert('Y', '123', $db);

var_dump($db, dba_fetch('X', $db));
var_dump($db, dba_fetch('key1', $db));

var_dump(dba_firstkey($db));
var_dump(dba_nextkey($db));
Expand All @@ -28,10 +24,12 @@ dba_close($db);
?>
--CLEAN--
<?php
require(__DIR__ .'/clean.inc');
require_once __DIR__ . '/setup/setup_dba_tests.inc';
$db_name = 'bug36436.db';
cleanup_standard_db($db_name);
?>
--EXPECTF--
resource(%d) of type (dba persistent)
string(3) "XYZ"
string(1) "X"
string(1) "Y"
string(16) "Content String 1"
string(13) "[key10]name10"
string(13) "[key30]name30"
28 changes: 0 additions & 28 deletions ext/dba/tests/bug48240.phpt

This file was deleted.

32 changes: 0 additions & 32 deletions ext/dba/tests/bug49125.phpt

This file was deleted.

43 changes: 0 additions & 43 deletions ext/dba/tests/bug62490.phpt

This file was deleted.

18 changes: 10 additions & 8 deletions ext/dba/tests/bug65708.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ Bug #65708 (dba functions cast $key param to string in-place, bypassing copy on
dba
--SKIPIF--
<?php
require_once(__DIR__ .'/skipif.inc');
require_once __DIR__ . '/setup/setup_dba_tests.inc';
check_skip_any();
?>
--FILE--
<?php
require_once __DIR__ . '/setup/setup_dba_tests.inc';
$name = 'bug65708.db';

error_reporting(E_ALL);

require_once(__DIR__ .'/test.inc');

$db = dba_popen($db_filename, 'c');
$db = get_any_db($name);

$key = 1;
$copy = $key;
Expand All @@ -31,9 +30,12 @@ dba_close($db);
?>
--CLEAN--
<?php
require(__DIR__ .'/clean.inc');
require_once __DIR__ . '/setup/setup_dba_tests.inc';
$db_name = 'bug65708.db';
cleanup_standard_db($db_name);
?>
--EXPECT--
--EXPECTF--
Using handler: "%s"
integer
integer
integer
Expand Down
28 changes: 0 additions & 28 deletions ext/dba/tests/bug72885.phpt

This file was deleted.

15 changes: 9 additions & 6 deletions ext/dba/tests/bug78808.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ Bug #78808 ([LMDB] MDB_MAP_FULL: Environment mapsize limit reached)
dba
--SKIPIF--
<?php
$handler = 'lmdb';
require_once __DIR__ .'/skipif.inc';
require_once __DIR__ . '/setup/setup_dba_tests.inc';
check_skip('lmdb');
?>
--FILE--
<?php
$handler = 'lmdb';
require_once __DIR__ .'/test.inc';
require_once __DIR__ . '/setup/setup_dba_tests.inc';
$db_name = 'bug78808.db';

$value = str_repeat('*', 0x100000);
$lmdb_h = dba_open($db_filename, 'c', 'lmdb', 0644, 5*1048576);
$lmdb_h = dba_open($db_name, 'c', 'lmdb', 0644, 5*1048576);
for ($i = 0; $i < 3; $i++) {
dba_insert('key' . $i, $value, $lmdb_h);
}
Expand All @@ -23,5 +24,7 @@ echo "done\n";
done
--CLEAN--
<?php
require_once dirname(__FILE__) .'/clean.inc';
require_once __DIR__ . '/setup/setup_dba_tests.inc';
$db_name = 'bug78808.db';
cleanup_standard_db($db_name);
?>
27 changes: 0 additions & 27 deletions ext/dba/tests/dba001.phpt

This file was deleted.

28 changes: 0 additions & 28 deletions ext/dba/tests/dba002.phpt

This file was deleted.

30 changes: 0 additions & 30 deletions ext/dba/tests/dba003.phpt

This file was deleted.

34 changes: 0 additions & 34 deletions ext/dba/tests/dba004.phpt

This file was deleted.

Loading