From: Michael Wallner Date: Fri, 12 Feb 2016 16:40:44 +0000 (+0100) Subject: cleanup test X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=eb8dda8a98e6a1623406175374d7c199bf27860c;p=m6w6%2Fext-psi cleanup test --- diff --git a/tests/sqlite/sqlite.psi b/tests/sqlite/sqlite.psi index 594332e..23669d6 100644 --- a/tests/sqlite/sqlite.psi +++ b/tests/sqlite/sqlite.psi @@ -23,15 +23,13 @@ typedef sqlite_int64 sqlite3_int64; typedef sqlite_uint64 sqlite3_uint64; extern void sqlite3_free(void *ptr); -function sqlite3\free(object $object) : void { - let ptr = objval($object); - return void(sqlite3_free); -} extern int sqlite3_close(sqlite3 *db); -function sqlite3\close(object $db) : int { +function sqlite3\close(object &$db) : int { let db = objval($db); return to_int(sqlite3_close); + // unset($db) as safe-guard + set $db = void(db); } extern int sqlite3_open(const char *filename, sqlite3 **db_ptr); diff --git a/tests/sqlite/sqlite001.phpt b/tests/sqlite/sqlite001.phpt index a5e1316..e45d169 100644 --- a/tests/sqlite/sqlite001.phpt +++ b/tests/sqlite/sqlite001.phpt @@ -52,6 +52,11 @@ if ($rc) { sqlite3\close($db); +$rc = sqlite3\exec($db, "SELECT *", "callback", new stdClass, $error); +if ($rc) { + printf("%s: '%s'\n", sqlite3\errstr($rc), $error); +} + ?> ===DONE=== --EXPECTF--