Trying to pimp gcov.php.net code coverage tests.. trying to cover mysqlnd compress code with a standard test run

This commit is contained in:
Ulf Wendel 2010-09-20 19:01:13 +00:00
parent f7c54d0737
commit 10974d77f4

View File

@ -100,14 +100,20 @@ require_once('skipifconnectfailure.inc');
}
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
function test_fetch($host, $user, $passwd, $db, $port, $socket, $engine, $flags = null) {
$link = mysqli_init();
if (!my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, $flags)) {
printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
$host, $user, $db, $port, $socket);
return false;
}
if (!mysqli_query($link, "DROP TABLE IF EXISTS test") ||
!mysqli_query($link, sprintf("CREATE TABLE test(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, label VARCHAR(255)) ENGINE = %s", $engine)))
!mysqli_query($link, sprintf("CREATE TABLE test(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, label VARCHAR(255)) ENGINE = %s", $engine))) {
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
return false;
}
$package_size = 524288;
$offset = 3;
@ -143,6 +149,12 @@ require_once('skipifconnectfailure.inc');
mysqli_close($link);
return true;
}
test_fetch($host, $user, $passwd, $db, $port, $socket, $engine, null);
test_fetch($host, $user, $passwd, $db, $port, $socket, $engine, MYSQLI_CLIENT_COMPRESS);
print "done!";
?>
--CLEAN--
@ -151,4 +163,5 @@ require_once('skipifconnectfailure.inc');
?>
--EXPECTF--
stop: %s
stop: %s
done!