com php-src: Add a bit more test cases (edge cases) to the BIT test case: ext/mysqli/tests/bug_bits.phpt

From: Date: Mon, 12 Dec 2016 19:52:36 +0000
Subject: com php-src: Add a bit more test cases (edge cases) to the BIT test case: ext/mysqli/tests/bug_bits.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-96311@lists.php.net to get a copy of this message
Commit: 13fc1b92ca0cd15db470bf4478449f51f9886eb5 Author: Andrey Hristov <andrey@php.net> Mon, 12 Dec 2016 21:52:36 +0200 Parents: a881ea7d86fd156adcf7aedb60ccc398583d082b Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=13fc1b92ca0cd15db470bf4478449f51f9886eb5 Log: Add a bit more test cases (edge cases) to the BIT test case Changed paths: M ext/mysqli/tests/bug_bits.phpt Diff: diff --git a/ext/mysqli/tests/bug_bits.phpt b/ext/mysqli/tests/bug_bits.phpt index d87505f..8a56469 100644 --- a/ext/mysqli/tests/bug_bits.phpt +++ b/ext/mysqli/tests/bug_bits.phpt @@ -21,7 +21,13 @@ if (!$link->query("CREATE TABLE bug_bits (inty bigint(20) unsigned NOT NULL printf("[003] [%d] %s\n", $link->errno, $link->error); } -$insertQuery = "INSERT INTO bug_bits VALUES (18446744073709551615, 18446744073709551615), (18446744073709551614, 18446744073709551614)"; +$insertQuery = "INSERT INTO bug_bits VALUES (18446744073709551615, 18446744073709551615)". + ",(18446744073709551614, 18446744073709551614)". + ",(4294967296, 4294967296)". + ",(4294967295, 4294967295)". + ",(2147483648, 2147483648)". + ",(2147483647, 2147483647)". + ",(1, 1)"; if (!$link->query($insertQuery)) { printf("[004] [%d] %s\n", $link->errno, $link->error); } @@ -44,7 +50,7 @@ require_once("connect.inc"); if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); -if (!mysqli_query($link, "DROP TABLE IF EXISTS bug72489")) +if (!mysqli_query($link, "DROP TABLE IF EXISTS bug_bits")) printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); @@ -62,4 +68,34 @@ array(2) { ["bitty"]=> string(20) "18446744073709551614" } +array(2) { + ["inty"]=> + string(10) "4294967296" + ["bitty"]=> + string(10) "4294967296" +} +array(2) { + ["inty"]=> + string(10) "4294967295" + ["bitty"]=> + string(10) "4294967295" +} +array(2) { + ["inty"]=> + string(10) "2147483648" + ["bitty"]=> + string(10) "2147483648" +} +array(2) { + ["inty"]=> + string(10) "2147483647" + ["bitty"]=> + string(10) "2147483647" +} +array(2) { + ["inty"]=> + string(1) "1" + ["bitty"]=> + string(1) "1" +} Done

« previous php.cvs (#96311) next »