tony2001 Fri Dec 19 12:03:13 2003 EDT
Modified files:
/php-src/ext/oci8/tests .cvsignore bug26133.phpt connect.inc
create_table.inc drop_table.inc skipif.inc
Log:
add tests to HEAD
Index: php-src/ext/oci8/tests/.cvsignore
diff -u /dev/null php-src/ext/oci8/tests/.cvsignore:1.2
--- /dev/null Fri Dec 19 12:03:13 2003
+++ php-src/ext/oci8/tests/.cvsignore Fri Dec 19 12:03:12 2003
@@ -0,0 +1,6 @@
+*.out
+*.php
+*.tmp
+*.diff
+*.exp
+*.log
\ No newline at end of file
Index: php-src/ext/oci8/tests/bug26133.phpt
diff -u /dev/null php-src/ext/oci8/tests/bug26133.phpt:1.2
--- /dev/null Fri Dec 19 12:03:13 2003
+++ php-src/ext/oci8/tests/bug26133.phpt Fri Dec 19 12:03:12 2003
@@ -0,0 +1,36 @@
+--TEST--
+Bug #26133 (ocifreedesc() segfault)
+--SKIPIF--
+<?php
+ require 'skipif.inc';
+?>
+--FILE--
+<?php
+ require 'connect.inc';
+ require 'create_table.inc';
+
+ if ($connection) {
+ $ora_sql = "INSERT INTO
+ ".$schema."php_test_table (id, value)
+ VALUES ('1','1')
+ RETURNING
+ ROWID
+ INTO :v_rowid ";
+
+ $statement = OCIParse($connection,$ora_sql);
+ $rowid = OCINewDescriptor($connection,OCI_D_ROWID);
+ OCIBindByName($statement,":v_rowid", $rowid,-1,OCI_B_ROWID);
+ if (OCIExecute($statement)) {
+ OCICommit($connection);
+ }
+ OCIFreeStatement($statement);
+ $rowid->free();
+ }
+
+ require 'drop_table.inc';
+
+ echo "Done\n";
+?>
+--EXPECTF--
+Done
+
Index: php-src/ext/oci8/tests/connect.inc
diff -u /dev/null php-src/ext/oci8/tests/connect.inc:1.2
--- /dev/null Fri Dec 19 12:03:13 2003
+++ php-src/ext/oci8/tests/connect.inc Fri Dec 19 12:03:12 2003
@@ -0,0 +1,39 @@
+<?php
+
+/*
+ * Please, change user, password and dbase to match your configuration.
+ *
+ * */
+
+$user = "user";
+$password = "pass";
+$dbase = "base";
+
+/*
+ * You should have privileges to create tables in this schema
+ *
+ * */
+
+$schema = "system";
+
+/*
+ * Remove the last line in skipif.inc to run tests
+ *
+ * */
+
+
+ if (!empty($dbase)) {
+ $connection = ocilogon($user,$password,$dbase);
+ }
+ else {
+ $connection = ocilogon($user,$password);
+ }
+
+ if (!empty($schema)) {
+ $schema = $schema.".";
+ }
+ else {
+ $schema = '';
+ }
+
+?>
Index: php-src/ext/oci8/tests/create_table.inc
diff -u /dev/null php-src/ext/oci8/tests/create_table.inc:1.2
--- /dev/null Fri Dec 19 12:03:13 2003
+++ php-src/ext/oci8/tests/create_table.inc Fri Dec 19 12:03:12 2003
@@ -0,0 +1,12 @@
+<?php
+
+ if ($connection) {
+ $ora_sql = "CREATE TABLE
+ ".$schema."php_test_table (id NUMBER, value NUMBER)
+ ";
+
+ $statement = OCIParse($connection,$ora_sql);
+ OCIExecute($statement);
+ }
+
+?>
Index: php-src/ext/oci8/tests/drop_table.inc
diff -u /dev/null php-src/ext/oci8/tests/drop_table.inc:1.2
--- /dev/null Fri Dec 19 12:03:13 2003
+++ php-src/ext/oci8/tests/drop_table.inc Fri Dec 19 12:03:12 2003
@@ -0,0 +1,12 @@
+<?php
+
+ if ($connection) {
+ $ora_sql = "DROP TABLE
+ ".$schema."php_test_table
+ ";
+
+ $statement = OCIParse($connection,$ora_sql);
+ OCIExecute($statement);
+ }
+
+?>
Index: php-src/ext/oci8/tests/skipif.inc
diff -u /dev/null php-src/ext/oci8/tests/skipif.inc:1.2
--- /dev/null Fri Dec 19 12:03:13 2003
+++ php-src/ext/oci8/tests/skipif.inc Fri Dec 19 12:03:12 2003
@@ -0,0 +1,10 @@
+<?php
+
+if (!extension_loaded('oci8')) die("skip oci8 extension is not available\n");
+
+/*
+ * Remove or comment this line to run tests
+ *
+ * */
+die("skip change default login/password\n");
+?>
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php