wez Thu Jan 8 11:55:38 2004 EDT
Modified files:
/php-src/ext/sqlite/tests blankdb.inc sqlite_oo_029.phpt
Log:
fix tests for win32
Index: php-src/ext/sqlite/tests/blankdb.inc
diff -u php-src/ext/sqlite/tests/blankdb.inc:1.3
php-src/ext/sqlite/tests/blankdb.inc:1.4
--- php-src/ext/sqlite/tests/blankdb.inc:1.3 Fri Dec 5 08:42:03 2003
+++ php-src/ext/sqlite/tests/blankdb.inc Thu Jan 8 11:55:37 2004
@@ -1,11 +1,16 @@
<?php #vim:ft=php
$dbname = tempnam(dirname(__FILE__), "phpsql");
function cleanup() {
+ $retry = 10;
+
if (is_resource($GLOBALS['db'])) {
@sqlite_close($GLOBALS['db']);
- usleep(500000);
}
- unlink($GLOBALS['dbname']);
+ do {
+ usleep(500000);
+ if (@unlink($GLOBALS['dbname']))
+ break;
+ } while (file_exists($GLOBALS['dbname']) && --$retry);
}
register_shutdown_function("cleanup");
$db = sqlite_open($dbname);
Index: php-src/ext/sqlite/tests/sqlite_oo_029.phpt
diff -u php-src/ext/sqlite/tests/sqlite_oo_029.phpt:1.2
php-src/ext/sqlite/tests/sqlite_oo_029.phpt:1.3
--- php-src/ext/sqlite/tests/sqlite_oo_029.phpt:1.2 Sat Dec 27 16:57:16 2003
+++ php-src/ext/sqlite/tests/sqlite_oo_029.phpt Thu Jan 8 11:55:37 2004
@@ -1,49 +1,49 @@
---TEST--
-sqlite-oo: call method with $this
---FILE--
-<?php
-include "blankdb_oo.inc";
-
-$db->query("CREATE TABLE strings(key VARCHAR(10), var VARCHAR(10))");
-$db->query("INSERT INTO strings VALUES('foo', 'foo')");
-
-class sqlite_help
-{
- function sqlite_help($db){
- $this->db = $db;
- $this->db->create_function('link_keywords', array(&$this, 'linkers'),
1);
- }
-
- function get_single($key)
- {
- return $this->db->single_query('SELECT link_keywords(var) FROM strings
WHERE key=\''.$key.'\'', 1);
- }
-
- function linkers($str)
- {
- $str = str_replace('foo', 'bar', $str);
- return $str;
- }
-
- function free()
- {
- unset($this->db);
- }
-
- function __destruct()
- {
- echo "DESTRUCTED\n";
- }
-}
-
-$obj = new sqlite_help($db);
-echo $obj->get_single('foo')."\n";;
-$obj->free();
-unset($obj);
-
-?>
-===DONE===
---EXPECT--
-bar
-===DONE===
-DESTRUCTED
\ No newline at end of file
+--TEST--
+sqlite-oo: call method with $this
+--FILE--
+<?php
+include "blankdb_oo.inc";
+
+$db->query("CREATE TABLE strings(key VARCHAR(10), var VARCHAR(10))");
+$db->query("INSERT INTO strings VALUES('foo', 'foo')");
+
+class sqlite_help
+{
+ function sqlite_help($db){
+ $this->db = $db;
+ $this->db->create_function('link_keywords', array(&$this, 'linkers'),
1);
+ }
+
+ function get_single($key)
+ {
+ return $this->db->single_query('SELECT link_keywords(var) FROM strings
WHERE key=\''.$key.'\'', 1);
+ }
+
+ function linkers($str)
+ {
+ $str = str_replace('foo', 'bar', $str);
+ return $str;
+ }
+
+ function free()
+ {
+ unset($this->db);
+ }
+
+ function __destruct()
+ {
+ echo "DESTRUCTED\n";
+ }
+}
+
+$obj = new sqlite_help($db);
+echo $obj->get_single('foo')."\n";
+$obj->free();
+unset($obj);
+
+?>
+===DONE===
+--EXPECT--
+bar
+===DONE===
+DESTRUCTED
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php