[PHP-CVS] cvs: php-src /ext/interbase/tests 006.phpt
abies Thu Apr 1 11:42:25 2004 EDT Modified files: /php-src/ext/interbase/tests006.phpt Log: Test binding of numeric timestamps http://cvs.php.net/diff.php/php-src/ext/interbase/tests/006.phpt?r1=1.8r2=1.9ty=u Index: php-src/ext/interbase/tests/006.phpt diff -u php-src/ext/interbase/tests/006.phpt:1.8 php-src/ext/interbase/tests/006.phpt:1.9 --- php-src/ext/interbase/tests/006.phpt:1.8Fri Sep 5 13:02:02 2003 +++ php-src/ext/interbase/tests/006.phptThu Apr 1 11:42:25 2004 @@ -5,7 +5,7 @@ --POST-- --GET-- --FILE-- -?php /* $Id: 006.phpt,v 1.8 2003/09/05 17:02:02 abies Exp $ */ +?php /* $Id: 006.phpt,v 1.9 2004/04/01 16:42:25 abies Exp $ */ require(interbase.inc); @@ -111,7 +111,7 @@ for($iter = 0; $iter 3; $iter++) { /* prepare data */ $v_char = rand_str(1000); - $v_date = rand_datetime(); + $v_date = (int)rand_number(10,0,0); $v_decimal = rand_number(12,3); $v_double = rand_number(20); $v_float = rand_number(7); @@ -127,8 +127,8 @@ ibase_query(insert into test6 (iter, v_char,v_date,v_decimal, v_integer,v_numeric,v_smallint,v_varchar) - values (666, '$v_char','$v_date',$v_decimal, $v_integer, - $v_numeric, $v_smallint, '$v_varchar')); + values (666, '$v_char',?,$v_decimal, $v_integer, + $v_numeric, $v_smallint, '$v_varchar'),$v_date); /* test all types */ if(!($sel = ibase_query( -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/interbase/tests 006.phpt
abies Fri Sep 5 08:18:04 2003 EDT Modified files: /php-src/ext/interbase/tests006.phpt Log: Make the test fail if anything goes wrong :-) Some CS Index: php-src/ext/interbase/tests/006.phpt diff -u php-src/ext/interbase/tests/006.phpt:1.6 php-src/ext/interbase/tests/006.phpt:1.7 --- php-src/ext/interbase/tests/006.phpt:1.6Wed Sep 3 13:15:40 2003 +++ php-src/ext/interbase/tests/006.phptFri Sep 5 08:18:03 2003 @@ -38,7 +38,7 @@ echo insert\n; - for($iter = 0; $iter 3; $iter++){ + for($iter = 0; $iter 3; $iter++) { /* prepare data */ $v_char = rand_str(1000); $v_date = rand_datetime(); @@ -59,47 +59,47 @@ $sel = ibase_query(select * from test6 where iter = $iter); $row = ibase_fetch_object($sel); - if(substr($row-V_CHAR,0,strlen($v_char)) != $v_char){ + if(substr($row-V_CHAR,0,strlen($v_char)) != $v_char) { echo CHAR fail:\n; echo in: $v_char\n; echo out: $row-V_CHAR\n; } - if($row-V_DATE != $v_date){ + if($row-V_DATE != $v_date) { echo DATE fail\n; echo in: $v_date\n; echo out: $row-V_DATE\n; } - if($row-V_DECIMAL != $v_decimal){ + if($row-V_DECIMAL != $v_decimal) { echo DECIMAL fail\n; echo in: $v_decimal\n; echo out: $row-V_DECIMAL\n; } - if(abs($row-V_DOUBLE - $v_double) abs($v_double / 1E15)){ + if(abs($row-V_DOUBLE - $v_double) abs($v_double / 1E15)) { echo DOUBLE fail\n; echo in: $v_double\n; echo out: $row-V_DOUBLE\n; } - if(abs($row-V_FLOAT - $v_float) abs($v_float / 1E7)){ + if(abs($row-V_FLOAT - $v_float) abs($v_float / 1E7)) { echo FLOAT fail\n; echo in: $v_float\n; echo out: $row-V_FLOAT\n; } - if($row-V_INTEGER != $v_integer){ + if($row-V_INTEGER != $v_integer) { echo INTEGER fail\n; echo in: $v_integer\n; echo out: $row-V_INTEGER\n; } - if ($row-V_NUMERIC != $v_numeric){ + if ($row-V_NUMERIC != $v_numeric) { echo NUMERIC fail\n; echo in: $v_numeric\n; echo out: $row-V_NUMERIC\n; } - if ($row-V_SMALLINT != $v_smallint){ + if ($row-V_SMALLINT != $v_smallint) { echo SMALLINT fail\n; echo in: $v_smallint\n; echo out: $row-V_SMALLINT\n; } - if ($row-V_VARCHAR != $v_varchar){ + if ($row-V_VARCHAR != $v_varchar) { echo VARCHAR fail:\n; echo in: $v_varchar\n; echo out: $row-V_VARCHAR\n; @@ -108,7 +108,7 @@ }/* for($iter)*/ echo select\n; - for($iter = 0; $iter 3; $iter++){ + for($iter = 0; $iter 3; $iter++) { /* prepare data */ $v_char = rand_str(1000); $v_date = rand_datetime(); @@ -132,35 +132,49 @@ /* test all types */ if(!($sel = ibase_query( - select iter from test6 where v_char = ?, $v_char))) + select iter from test6 where v_char = ?, $v_char)) || + !ibase_fetch_row($sel)) { echo CHAR fail\n; + } ibase_free_result($sel); if(!($sel = ibase_query( - select iter from test6 where v_date = ?, $v_date))) + select iter from test6 where v_date = ?, $v_date)) || + !ibase_fetch_row($sel)) { echo DATE fail\n; + } ibase_free_result($sel); if(!($sel = ibase_query( - select iter from test6 where v_decimal = ?, $v_decimal))) + select iter from test6 where v_decimal = ?, $v_decimal)) || + !ibase_fetch_row($sel)) { echo DECIMAL fail\n; + } ibase_free_result($sel); if(!($sel = ibase_query( - select iter from test6 where v_integer = ?, $v_integer))) + select iter from test6 where v_integer = ?, $v_integer)) || +
[PHP-CVS] cvs: php-src /ext/interbase/tests 006.phpt
abies Wed Sep 3 11:24:51 2003 EDT Modified files: /php-src/ext/interbase/tests006.phpt Log: Test correct binding of 16-bit NUMERIC parameters Index: php-src/ext/interbase/tests/006.phpt diff -u php-src/ext/interbase/tests/006.phpt:1.4 php-src/ext/interbase/tests/006.phpt:1.5 --- php-src/ext/interbase/tests/006.phpt:1.4Wed Aug 27 20:18:27 2003 +++ php-src/ext/interbase/tests/006.phptWed Sep 3 11:24:50 2003 @@ -89,6 +89,21 @@ echo in: $v_integer\n; echo out: $row-V_INTEGER\n; } +if ($row-V_NUMERIC != $v_numeric){ +echo NUMERIC fail\n; +echo in: $v_numeric\n; +echo out: $row-V_NUMERIC\n; +} +if ($row-V_SMALLINT != $v_smallint){ +echo SMALLINT fail\n; +echo in: $v_smallint\n; +echo out: $row-V_SMALLINT\n; +} + if ($row-V_VARCHAR != $v_varchar){ + echo VARCHAR fail:\n; +echo in: $v_varchar\n; +echo out: $row-V_VARCHAR\n; +} ibase_free_result($sel); }/* for($iter)*/ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php