Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

Commit

Permalink
Test cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
tricky committed Jan 2, 2011
1 parent a7a0e2d commit 31a5a1b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
20 changes: 8 additions & 12 deletions tests/008.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ function test($type, $variable) {

echo $type, "\n";
echo substr(bin2hex($serialized), 8), "\n";
echo $unserialized == $variable ? 'OK' : 'ERROR';
if ($unserialized != $variable) {
echo 'ERROR, expected: ';
var_dump($variable);
echo 'got: ';
var_dump($unserialized);
} else {
echo 'OK';
}
echo "\n";
}

Expand All @@ -22,17 +29,6 @@ test('array("one" => 1, "two" => 2))', array("one" => 1, "two" => 2));
test('array("kek" => "lol", "lol" => "kek")', array("kek" => "lol", "lol" => "kek"));
test('array("" => "empty")', array("" => "empty"));

/*
* you can add regression tests for your extension here
*
* the output of your test code has to be equal to the
* text in the --EXPECT-- section below for the tests
* to pass, differences between the output and the
* expected text are interpreted as failure
*
* see php5/README.TESTING for further information on
* writing regression tests
*/
?>
--EXPECT--
array("foo", "foo", "foo")
Expand Down
8 changes: 4 additions & 4 deletions tests/035.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
Profiling perf test.
--SKIPIF--
<?php
if (!extension_loaded("igbinary") || !extension_loaded("mcrypt")) {
print "skip";
if (!extension_loaded("igbinary")) {
print "skip no igbinary";
}
if (!isset($_ENV['TEST_PERFORMANCE']) || !$_ENV['TEST_PERFORMANCE']) {
echo "skip set TEST_PERFORMANCE=1 environment to enable trivial performance test";
}
?>
--INI--
igbinary.compact_strings=Off
--FILE--
<?php
$t = time();
$data_array = array();
for ($i = 0; $i < 5000; $i++) {
$data_array[mcrypt_create_iv(10, MCRYPT_DEV_URANDOM)] = mcrypt_create_iv(10, MCRYPT_DEV_URANDOM);
$data_array[md5($i)] = md5($i . $t);
}

$time_start = microtime(true);
Expand Down

0 comments on commit 31a5a1b

Please sign in to comment.