]> granicus.if.org Git - php/commitdiff
fix tests for win32
authorWez Furlong <wez@php.net>
Thu, 8 Jan 2004 16:55:37 +0000 (16:55 +0000)
committerWez Furlong <wez@php.net>
Thu, 8 Jan 2004 16:55:37 +0000 (16:55 +0000)
ext/sqlite/tests/blankdb.inc
ext/sqlite/tests/sqlite_oo_029.phpt

index 1937c515ed481e922bbb05375ee63ca9306f84ce..43c6ff3582e721237409ad98e07570a00812db2e 100644 (file)
@@ -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 f6babeb5b801d4b7b0ac775177159bc4a158394b..23a819295a4f13a37cb36f6c3c969c1605fc34fa 100755 (executable)
@@ -1,7 +1,7 @@
 --TEST--
 sqlite-oo: call method with $this
 --FILE--
-<?php 
+<?php
 include "blankdb_oo.inc";
 
 $db->query("CREATE TABLE strings(key VARCHAR(10), var VARCHAR(10))");
@@ -29,7 +29,7 @@ class sqlite_help
        {
                unset($this->db);
        }
-       
+
        function __destruct()
        {
                echo "DESTRUCTED\n";
@@ -37,7 +37,7 @@ class sqlite_help
 }
 
 $obj = new sqlite_help($db);
-echo $obj->get_single('foo')."\n";;
+echo $obj->get_single('foo')."\n";
 $obj->free();
 unset($obj);
 
@@ -46,4 +46,4 @@ unset($obj);
 --EXPECT--
 bar
 ===DONE===
-DESTRUCTED
\ No newline at end of file
+DESTRUCTED