Author: ahristov
Date: 2007-06-26 09:29:38 +0200 (Tue, 26 Jun 2007)
New Revision: 485
Modified:
trunk/tests/ext/mysqli/mysqli_fetch_assoc_no_alias_utf8.phpt
trunk/tests/ext/mysqli/mysqli_set_local_infile_handler.phpt
trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_bad_character.phpt
trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_buffer_overflow.phpt
trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_negative_len.phpt
trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_nested_call.phpt
trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_nofileop.phpt
trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_replace_buffer.phpt
trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_short_len.phpt
Log:
Fix tests so they clean the temp file after they are finished.
Fix utf8 test and add also three-byte utf8 sequences. Used Google
Translator for translating the first names of the mysqlnd creators.
If translations are wrong the Google tool is to blame :)
Modified: trunk/tests/ext/mysqli/mysqli_fetch_assoc_no_alias_utf8.phpt
- trunk/tests/ext/mysqli/mysqli_fetch_assoc_no_alias_utf8.phpt 2007-06-25 18:32:10 UTC (rev 484)
+++ trunk/tests/ext/mysqli/mysqli_fetch_assoc_no_alias_utf8.phpt 2007-06-26 07:29:38 UTC (rev 485)
@@ -32,34 +32,37 @@
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
}
- if (!$res = mysqli_query($link, "SELECT 1 AS 'Ð?ндÑей Ð¥ÑиÑ?Ñов', 2 AS 'Ð£Ð»Ñ Ðендел', 3 AS 'ÐеоÑг РиÑ
ÑеÑ'")) {
+ if (!$res = mysqli_query($link, "SELECT 1 AS 'ÐндÑей Ð¥ÑиÑÑов', 2 AS 'Ð£Ð»Ñ Ðендел', 3 AS 'ÐеоÑг РиÑ
ÑеÑ'")) {
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
}
print "[003]\n";
var_dump(mysqli_fetch_assoc($res));
mysqli_free_result($res);
- if (!$res = mysqli_query($link, "CREATE TABLE авÑоÑи_на_mysqlnd (id integer not null auto_increment primary key, име varchar(20) character set ucs2, ÑамилиÑ? varchar(20) character set utf8)")) {
+ if (!$res = mysqli_query($link, "CREATE TABLE авÑоÑи_на_mysqlnd (id integer not null auto_increment primary key, име varchar(20) character set ucs2, ÑÐ°Ð¼Ð¸Ð»Ð¸Ñ varchar(20) character set utf8)")) {
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
}
- if (!$res = mysqli_query($link, "INSERT INTO авÑоÑи_на_mysqlnd (име, ÑамилиÑ?) VALUES ('Ð?ндÑей', 'Ð¥ÑиÑ?Ñов'), ('ÐеоÑг', 'РиÑ
ÑеÑ'), ('УлÑ','Ðендел')")) {
+ if (!$res = mysqli_query($link, "INSERT INTO авÑоÑи_на_mysqlnd (име, ÑамилиÑ) VALUES ('ÐндÑей', 'Ð¥ÑиÑÑов'), ('ÐеоÑг', 'РиÑ
ÑеÑ'), ('УлÑ','Ðендел')")) {
printf("[005] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
}
- if (!$res = mysqli_query($link, "INSERT INTO авÑоÑи_на_mysqlnd (име, ÑамилиÑ?) VALUES ('Andrey', 'Hristov'), ('Georg', 'Richter'), ('Ulf','Wendel')")) {
+ if (!$res = mysqli_query($link, "INSERT INTO авÑоÑи_на_mysqlnd (име, ÑамилиÑ) VALUES ('Andrey', 'Hristov'), ('Georg', 'Richter'), ('Ulf','Wendel')")) {
printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
}
-
- if (!$res = mysqli_query($link, "SELECT id, име, ÑамилиÑ? FROM авÑоÑи_на_mysqlnd ORDER BY ÑамилиÑ?")) {
+ if (!$res = mysqli_query($link, "INSERT INTO авÑоÑи_на_mysqlnd (име, ÑамилиÑ) VALUES ('å®å¾·ç', 'Hristov'), ('æ ¼å¥¥å°', 'Richter'), ('ä¹å°å¤«','Wendel')")) {
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
}
- print "[008]\n";
+
+ if (!$res = mysqli_query($link, "SELECT id, име, ÑÐ°Ð¼Ð¸Ð»Ð¸Ñ FROM авÑоÑи_на_mysqlnd ORDER BY ÑамилиÑ, име")) {
+ printf("[008] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+ }
+ print "[009]\n";
while ($row = mysqli_fetch_assoc($res)) {
var_dump($row);
}
mysqli_free_result($res);
if (!$res = mysqli_query($link, "DROP TABLE автори_на_mysqlnd")) {
- printf("[009] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+ printf("[010] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
}
mysqli_close($link);
@@ -69,44 +72,68 @@ --EXPECTF--
[003]
array(3) {
- ["Ð?ндÑей Ð¥ÑиÑ?Ñов"]=>
+ ["ÐндÑей Ð¥ÑиÑÑов"]=>
string(1) "1"
["Ð£Ð»Ñ Ðендел"]=>
string(1) "2"
["ÐеоÑг РиÑ
ÑеÑ"]=>
string(1) "3"
}
-[008]
+[009]
array(3) {
["id"]=>
string(1) "4"
["име"]=>
string(6) "Andrey"
- ["ÑамилиÑ?"]=>
+ ["ÑамилиÑ"]=>
string(7) "Hristov"
}
array(3) {
["id"]=>
+ string(1) "7"
+ ["име"]=>
+ string(9) "安德烈"
+ ["фамилия"]=>
+ string(7) "Hristov"
+}
+array(3) {
+ ["id"]=>
string(1) "5"
["име"]=>
string(5) "Georg"
- ["фамили?"]=>
+ ["фамилия"]=>
string(7) "Richter"
}
array(3) {
["id"]=>
+ string(1) "8"
+ ["име"]=>
+ string(9) "格奥尔"
+ ["фамилия"]=>
+ string(7) "Richter"
+}
+array(3) {
+ ["id"]=>
string(1) "6"
["име"]=>
string(3) "Ulf"
- ["ÑамилиÑ?"]=>
+ ["ÑамилиÑ"]=>
string(6) "Wendel"
}
array(3) {
["id"]=>
+ string(1) "9"
+ ["име"]=>
+ string(9) "乌尔夫"
+ ["фамилия"]=>
+ string(6) "Wendel"
+}
+array(3) {
+ ["id"]=>
string(1) "3"
["име"]=>
string(6) "УлÑ"
- ["ÑамилиÑ?"]=>
+ ["ÑамилиÑ"]=>
string(12) "Ðендел"
}
array(3) {
@@ -114,59 +141,83 @@
string(1) "2"
["име"]=>
string(10) "ÐеоÑг"
- ["ÑамилиÑ?"]=>
+ ["ÑамилиÑ"]=>
string(12) "РиÑ
ÑеÑ"
}
array(3) {
["id"]=>
string(1) "1"
["име"]=>
- string(12) "?ндрей"
- ["фамили?"]=>
- string(14) "Хри?тов"
+ string(12) "Андрей"
+ ["ÑамилиÑ"]=>
+ string(14) "Ð¥ÑиÑÑов"
}
done!
--UEXPECTF--
[003]
array(3) {
- [u"Ð?ндÑей Ð¥ÑиÑ?Ñов"]=>
+ [u"ÐндÑей Ð¥ÑиÑÑов"]=>
unicode(1) "1"
[u"Ð£Ð»Ñ Ðендел"]=>
unicode(1) "2"
[u"ÐеоÑг РиÑ
ÑеÑ"]=>
unicode(1) "3"
}
-[008]
+[009]
array(3) {
[u"id"]=>
unicode(1) "4"
[u"име"]=>
unicode(6) "Andrey"
- [u"ÑамилиÑ?"]=>
+ [u"ÑамилиÑ"]=>
unicode(7) "Hristov"
}
array(3) {
[u"id"]=>
+ unicode(1) "7"
+ [u"име"]=>
+ unicode(3) "安德烈"
+ [u"фамилия"]=>
+ unicode(7) "Hristov"
+}
+array(3) {
+ [u"id"]=>
unicode(1) "5"
[u"име"]=>
unicode(5) "Georg"
- [u"фамили?"]=>
+ [u"фамилия"]=>
unicode(7) "Richter"
}
array(3) {
[u"id"]=>
+ unicode(1) "8"
+ [u"име"]=>
+ unicode(3) "格奥尔"
+ [u"фамилия"]=>
+ unicode(7) "Richter"
+}
+array(3) {
+ [u"id"]=>
unicode(1) "6"
[u"име"]=>
unicode(3) "Ulf"
- [u"ÑамилиÑ?"]=>
+ [u"ÑамилиÑ"]=>
unicode(6) "Wendel"
}
array(3) {
[u"id"]=>
+ unicode(1) "9"
+ [u"име"]=>
+ unicode(3) "乌尔夫"
+ [u"фамилия"]=>
+ unicode(6) "Wendel"
+}
+array(3) {
+ [u"id"]=>
unicode(1) "3"
[u"име"]=>
unicode(3) "УлÑ"
- [u"ÑамилиÑ?"]=>
+ [u"ÑамилиÑ"]=>
unicode(6) "Ðендел"
}
array(3) {
@@ -174,15 +225,15 @@
unicode(1) "2"
[u"име"]=>
unicode(5) "ÐеоÑг"
- [u"ÑамилиÑ?"]=>
+ [u"ÑамилиÑ"]=>
unicode(6) "РиÑ
ÑеÑ"
}
array(3) {
[u"id"]=>
unicode(1) "1"
[u"име"]=>
- unicode(6) "?ндрей"
- [u"фамили?"]=>
- unicode(7) "Хри?тов"
+ unicode(6) "Андрей"
+ [u"ÑамилиÑ"]=>
+ unicode(7) "Ð¥ÑиÑÑов"
}
done!
\ No newline at end of file
Modified: trunk/tests/ext/mysqli/mysqli_set_local_infile_handler.phpt
- trunk/tests/ext/mysqli/mysqli_set_local_infile_handler.phpt 2007-06-25 18:32:10 UTC (rev 484)
+++ trunk/tests/ext/mysqli/mysqli_set_local_infile_handler.phpt 2007-06-26 07:29:38 UTC (rev 485)
@@ -11,7 +11,13 @@
<?php
include "connect.inc";
include("table.inc");
-
+
+ function shutdown_clean($file) {
+ if ($file) {
+ unlink($file);
+ }
+ }
+
function callback_simple($fp, &$buffer, $buflen, &$error) {
static $invocation = 0;
@@ -103,6 +109,8 @@
$file = tempnam(sys_get_temp_dir(), 'mysqli_test');
if (!$fp = fopen($file, 'w'))
printf("[005] Cannot create CVS file '%s'\n", $file);
+ else
+ register_shutdown_function("shutdown_clean", $file);
if (!fwrite($fp, "97;'x';\n") ||
!fwrite($fp, "98;'y';\n") ||
@@ -200,7 +208,7 @@
if (!is_null($tmp = @mysqli_set_local_infile_handler($link, 'callback_simple')))
printf("[300] Expecting NULL/NULL got %s/%s\n", $tmp, gettype($tmp));
-
+
print "done!";
?>
--EXPECTF--
@@ -213,4 +221,4 @@
Callback set to 'callback_error'
Callback: 0
Should bail or warn!
-done!
\ No newline at end of file
+done!
Modified: trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_bad_character.phpt
- trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_bad_character.phpt 2007-06-25 18:32:10 UTC (rev 484)
+++ trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_bad_character.phpt 2007-06-26 07:29:38 UTC (rev 485)
@@ -11,6 +11,12 @@
<?php
include "connect.inc";
include("table.inc");
+
+ function shutdown_clean($file) {
+ if ($file) {
+ unlink($file);
+ }
+ }
function callback_bad_character($fp, &$buffer, $buflen, &$error) {
static $invocation = 0;
@@ -84,6 +90,8 @@
$file = tempnam(sys_get_temp_dir(), 'mysqli_test');
if (!$fp = fopen($file, 'w'))
printf("[005] Cannot create CVS file '%s'\n", $file);
+ else
+ register_shutdown_function("shutdown_clean", $file);
if (!fwrite($fp, "97;'x';\n") ||
!fwrite($fp, "98;'y';\n") ||
Modified: trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_buffer_overflow.phpt
- trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_buffer_overflow.phpt 2007-06-25 18:32:10 UTC (rev 484)
+++ trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_buffer_overflow.phpt 2007-06-26 07:29:38 UTC (rev 485)
@@ -12,6 +12,11 @@
include "connect.inc";
include("table.inc");
+ function shutdown_clean($file) {
+ if ($file) {
+ unlink($file);
+ }
+ }
function callback_buffer_overflow($fp, &$buffer, $buflen, &$error) {
static $invocation = 0;
@@ -85,6 +90,8 @@
$file = tempnam(sys_get_temp_dir(), 'mysqli_test');
if (!$fp = fopen($file, 'w'))
printf("[005] Cannot create CVS file '%s'\n", $file);
+ else
+ register_shutdown_function("shutdown_clean", $file);
if (!fwrite($fp, "97;'x';\n") ||
!fwrite($fp, "98;'y';\n") ||
@@ -102,10 +109,10 @@
);
try_handler(20, $link, $file, 'callback_buffer_overflow', $expected);
- mysqli_close($link);
+ mysqli_close($link);
print "done!";
?>
--EXPECTF--
Callback set to 'callback_buffer_overflow'
Callback: 0
-done!
\ No newline at end of file
+done!
Modified: trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_negative_len.phpt
- trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_negative_len.phpt 2007-06-25 18:32:10 UTC (rev 484)
+++ trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_negative_len.phpt 2007-06-26 07:29:38 UTC (rev 485)
@@ -11,8 +11,13 @@
<?php
include "connect.inc";
include("table.inc");
+
+ function shutdown_clean($file) {
+ if ($file) {
+ unlink($file);
+ }
+ }
-
function callback_negative_len($fp, &$buffer, $buflen, &$error) {
static $invocation = 0;
@@ -84,6 +89,8 @@
$file = tempnam(sys_get_temp_dir(), 'mysqli_test');
if (!$fp = fopen($file, 'w'))
printf("[005] Cannot create CVS file '%s'\n", $file);
+ else
+ register_shutdown_function("shutdown_clean", $file);
if (!fwrite($fp, "97;'x';\n") ||
!fwrite($fp, "98;'y';\n") ||
@@ -107,4 +114,4 @@ --EXPECTF--
Callback set to 'callback_buffer_overflow'
Callback: 0
-done!
\ No newline at end of file
+done!
Modified: trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_nested_call.phpt
- trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_nested_call.phpt 2007-06-25 18:32:10 UTC (rev 484)
+++ trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_nested_call.phpt 2007-06-26 07:29:38 UTC (rev 485)
@@ -12,6 +12,11 @@
include "connect.inc";
include("table.inc");
+ function shutdown_clean($file) {
+ if ($file) {
+ unlink($file);
+ }
+ }
function callback_simple($fp, &$buffer, $buflen, &$error) {
static $invocation = 0;
@@ -131,6 +136,8 @@
$file = tempnam(sys_get_temp_dir(), 'mysqli_test');
if (!$fp = fopen($file, 'w'))
printf("[005] Cannot create CVS file '%s'\n", $file);
+ else
+ register_shutdown_function("shutdown_clean", $file);
if (!fwrite($fp, "97;'x';\n") ||
!fwrite($fp, "98;'y';\n") ||
@@ -160,4 +167,4 @@
Callback: 0
Callback: 1
Callback: 1
-done!
\ No newline at end of file
+done!
Modified: trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_nofileop.phpt
- trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_nofileop.phpt 2007-06-25 18:32:10 UTC (rev 484)
+++ trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_nofileop.phpt 2007-06-26 07:29:38 UTC (rev 485)
@@ -11,6 +11,12 @@
<?php
include "connect.inc";
include("table.inc");
+
+ function shutdown_clean($file) {
+ if ($file) {
+ unlink($file);
+ }
+ }
function callback_nofileop($fp, &$buffer, $buflen, &$error) {
static $invocation = 0;
@@ -83,6 +89,8 @@
$file = tempnam(sys_get_temp_dir(), 'mysqli_test');
if (!$fp = fopen($file, 'w'))
printf("[005] Cannot create CVS file '%s'\n", $file);
+ else
+ register_shutdown_function("shutdown_clean", $file);
if (!fwrite($fp, "97;'x';\n") ||
!fwrite($fp, "98;'y';\n") ||
@@ -105,4 +113,4 @@ --EXPECTF--
Callback set to 'callback_nofileop'
Callback: 0
-done!
\ No newline at end of file
+done!
Modified: trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_replace_buffer.phpt
- trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_replace_buffer.phpt 2007-06-25 18:32:10 UTC (rev 484)
+++ trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_replace_buffer.phpt 2007-06-26 07:29:38 UTC (rev 485)
@@ -12,6 +12,12 @@
include "connect.inc";
include("table.inc");
+ function shutdown_clean($file) {
+ if ($file) {
+ unlink($file);
+ }
+ }
+
function callback_replace_buffer($fp, &$buffer, $buflen, &$error) {
static $invocation = 0;
@@ -87,6 +93,8 @@
$file = tempnam(sys_get_temp_dir(), 'mysqli_test');
if (!$fp = fopen($file, 'w'))
printf("[005] Cannot create CVS file '%s'\n", $file);
+ else
+ register_shutdown_function("shutdown_clean", $file);
if (!fwrite($fp, "97;'x';\n") ||
!fwrite($fp, "98;'y';\n") ||
@@ -109,4 +117,4 @@ --EXPECTF--
Callback set to 'callback_nofileop'
Callback: 0
-done!
\ No newline at end of file
+done!
Modified: trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_short_len.phpt
- trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_short_len.phpt 2007-06-25 18:32:10 UTC (rev 484)
+++ trunk/tests/ext/mysqli/mysqli_set_local_infile_handler_short_len.phpt 2007-06-26 07:29:38 UTC (rev 485)
@@ -12,6 +12,11 @@
include "connect.inc";
include("table.inc");
+ function shutdown_clean($file) {
+ if ($file) {
+ unlink($file);
+ }
+ }
function callback_short_len($fp, &$buffer, $buflen, &$error) {
static $invocation = 0;
@@ -124,6 +129,8 @@
$file = tempnam(sys_get_temp_dir(), 'mysqli_test');
if (!$fp = fopen($file, 'w'))
printf("[005] Cannot create CVS file '%s'\n", $file);
+ else
+ register_shutdown_function("shutdown_clean", $file);
if (!fwrite($fp, "97;'x';\n") ||
!fwrite($fp, "98;'y';\n") ||
@@ -151,4 +158,4 @@
Callback set to 'callback_short_len'
Callback: 0
Callback: 1
-done!
\ No newline at end of file
+done!
--
MySQL Code Commits Mailing List
For list archives:
http://lists.mysql.com/commits
To unsubscribe:
http://lists.mysql.com/commits?unsub=lists@pantek.com
Received on Tue Jun 26 03:33:42 2007