]> granicus.if.org Git - php/commitdiff
additional tests for non freed objects
authorGeorg Richter <georg@php.net>
Mon, 17 Feb 2003 23:29:58 +0000 (23:29 +0000)
committerGeorg Richter <georg@php.net>
Mon, 17 Feb 2003 23:29:58 +0000 (23:29 +0000)
ext/mysqli/tests/050.phpt [new file with mode: 0644]
ext/mysqli/tests/051.phpt [new file with mode: 0644]
ext/mysqli/tests/052.phpt [new file with mode: 0644]
ext/mysqli/tests/053.phpt [new file with mode: 0644]
ext/mysqli/tests/054.phpt [new file with mode: 0644]
ext/mysqli/tests/055.phpt [new file with mode: 0644]

diff --git a/ext/mysqli/tests/050.phpt b/ext/mysqli/tests/050.phpt
new file mode 100644 (file)
index 0000000..9ab5d34
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+non freed statement test 
+--FILE--
+<?php
+       include "connect.inc";
+       
+       /************************
+        * non freed stamement
+        ************************/
+       $link = mysqli_connect("localhost", $user, $passwd);
+
+       $stmt = mysqli_prepare($link, "SELECT CURRENT_USER()");
+       mysqli_execute($stmt);
+
+       mysqli_close($link);
+       printf("Ok\n");
+?>
+--EXPECT--
+Ok
diff --git a/ext/mysqli/tests/051.phpt b/ext/mysqli/tests/051.phpt
new file mode 100644 (file)
index 0000000..746597e
--- /dev/null
@@ -0,0 +1,20 @@
+--TEST--
+free statement after close 
+--FILE--
+<?php
+       include "connect.inc";
+       
+       /************************
+        * free statement after close 
+        ************************/
+       $link = mysqli_connect("localhost", $user, $passwd);
+
+       $stmt1 = mysqli_prepare($link, "SELECT CURRENT_USER()");
+       mysqli_execute($stmt1);
+
+       mysqli_close($link);
+       mysqli_stmt_close($stmt1);
+       printf("Ok\n");
+?>
+--EXPECT--
+Ok
diff --git a/ext/mysqli/tests/052.phpt b/ext/mysqli/tests/052.phpt
new file mode 100644 (file)
index 0000000..5682478
--- /dev/null
@@ -0,0 +1,20 @@
+--TEST--
+call statement after close
+--FILE--
+<?php
+       include "connect.inc";
+       
+       /************************
+        * statement call  after close 
+        ************************/
+       $link = mysqli_connect("localhost", $user, $passwd);
+
+       $stmt2 = mysqli_prepare($link, "SELECT CURRENT_USER()");
+
+       mysqli_close($link);
+       mysqli_execute($stmt2);
+       mysqli_stmt_close($stmt2);
+       printf("Ok\n");
+?>
+--EXPECT--
+Ok
diff --git a/ext/mysqli/tests/053.phpt b/ext/mysqli/tests/053.phpt
new file mode 100644 (file)
index 0000000..f542d0f
--- /dev/null
@@ -0,0 +1,18 @@
+--TEST--
+not freed resultset 
+--FILE--
+<?php
+       include "connect.inc";
+       
+       /************************
+        * non freed resultset 
+        ************************/
+       $link = mysqli_connect("localhost", $user, $passwd);
+
+       $result = mysqli_query($link, "SELECT CURRENT_USER()");
+       mysqli_close($link);
+       printf("Ok\n");
+
+?>
+--EXPECT--
+Ok
diff --git a/ext/mysqli/tests/054.phpt b/ext/mysqli/tests/054.phpt
new file mode 100644 (file)
index 0000000..eab207d
--- /dev/null
@@ -0,0 +1,18 @@
+--TEST--
+free resultset after close 
+--FILE--
+<?php
+       include "connect.inc";
+       
+       /************************
+        * free resultset after close 
+        ************************/
+       $link = mysqli_connect("localhost", $user, $passwd);
+
+       $result1 = mysqli_query($link, "SELECT CURRENT_USER()");
+       mysqli_close($link);
+       mysqli_free_result($result1);
+       printf("Ok\n");
+?>
+--EXPECT--
+Ok
diff --git a/ext/mysqli/tests/055.phpt b/ext/mysqli/tests/055.phpt
new file mode 100644 (file)
index 0000000..e777bcf
--- /dev/null
@@ -0,0 +1,17 @@
+--TEST--
+free nothing 
+--FILE--
+<?php
+       include "connect.inc";
+       
+       /************************
+        * don't free anything 
+        ************************/
+       $link = mysqli_connect("localhost", $user, $passwd);
+
+       $result2 = mysqli_query($link, "SELECT CURRENT_USER()");
+       $stmt2 = mysqli_prepare($link, "SELECT CURRENT_USER()");
+       printf("Ok\n");
+?>
+--EXPECT--
+Ok