[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pecl-cvs
Subject:    [PECL-CVS] =?utf-8?q?svn:_/pecl/dbase/trunk/_dbase.c_tests/bug52112.phpt_tests/dbase=5Fadd=5Frecord=
From:       Christoph_Michael_Becker <cmb () php ! net>
Date:       2016-10-30 13:01:47
Message-ID: svn-cmb-1477832507-340799-1069680145 () svn ! php ! net
[Download RAW message or body]

cmb                                      Sun, 30 Oct 2016 13:01:47 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=340799

Log:
Retrieve logical values as bool

The former behavior to retrieve logical values as int(1) or int(0) isn't
particularly useful with regard to strict_types, so now we're returning
bool(true) and bool(false), respectively.

Changed paths:
    U   pecl/dbase/trunk/dbase.c
    U   pecl/dbase/trunk/tests/bug52112.phpt
    U   pecl/dbase/trunk/tests/dbase_add_record_basic.phpt
    U   pecl/dbase/trunk/tests/dbase_add_record_variation1.phpt
    U   pecl/dbase/trunk/tests/dbase_add_record_variation2.phpt
    U   pecl/dbase/trunk/tests/dbase_delete_record_basic.phpt
    U   pecl/dbase/trunk/tests/dbase_get_record_basic.phpt
    U   pecl/dbase/trunk/tests/dbase_get_record_with_names_basic.phpt
    U   pecl/dbase/trunk/tests/dbase_pack_basic.phpt
    U   pecl/dbase/trunk/tests/dbase_replace_record_basic.phpt
    U   pecl/dbase/trunk/tests/dbase_replace_record_variation1.phpt
    U   pecl/dbase/trunk/tests/dbase_replace_record_variation2.phpt
    U   pecl/dbase/trunk/tests/type_logical.phpt

Modified: pecl/dbase/trunk/dbase.c
===================================================================
--- pecl/dbase/trunk/dbase.c	2016-10-30 12:37:58 UTC (rev 340798)
+++ pecl/dbase/trunk/dbase.c	2016-10-30 13:01:47 UTC (rev 340799)
@@ -425,15 +425,15 @@
 						   decimals, which we don't care about.      3/14/2001 LEW */
 				if ((*str_value == 'T') || (*str_value == 'Y')) {
 					if (!assoc) {
-						add_next_index_long(return_value, 1L);
+						add_next_index_bool(return_value, 1);
 					} else {
-						add_assoc_long(return_value, cur_f->db_fname, 1L);
+						add_assoc_bool(return_value, cur_f->db_fname, 1);
 					}
 				} else {
 					if (!assoc) {
-						add_next_index_long(return_value, 0L);
+						add_next_index_bool(return_value, 0);
 					} else {
-						add_assoc_long(return_value, cur_f->db_fname, 0L);
+						add_assoc_bool(return_value, cur_f->db_fname, 0);
 					}
 				}
 				break;

Modified: pecl/dbase/trunk/tests/bug52112.phpt
===================================================================
--- pecl/dbase/trunk/tests/bug52112.phpt	2016-10-30 12:37:58 UTC (rev 340798)
+++ pecl/dbase/trunk/tests/bug52112.phpt	2016-10-30 13:01:47 UTC (rev 340799)
@@ -35,7 +35,7 @@
   [3]=>
   string(18) "19840501000000.000"
   [4]=>
-  int(1)
+  bool(true)
   [5]=>
   float(123,45)
   ["deleted"]=>
@@ -51,7 +51,7 @@
   ["RELEASED_X"]=>
   string(18) "19840501000000.000"
   ["SUPORTED"]=>
-  int(1)
+  bool(true)
   ["PRICE"]=>
   float(123,45)
   ["deleted"]=>

Modified: pecl/dbase/trunk/tests/dbase_add_record_basic.phpt
===================================================================
--- pecl/dbase/trunk/tests/dbase_add_record_basic.phpt	2016-10-30 12:37:58 UTC (rev 340798)
+++ pecl/dbase/trunk/tests/dbase_add_record_basic.phpt	2016-10-30 13:01:47 UTC (rev 340799)
@@ -34,7 +34,7 @@
   [3]=>
   string(18) "19730101104923.123"
   [4]=>
-  int(0)
+  bool(false)
   [5]=>
   float(1234567.89)
   ["deleted"]=>

Modified: pecl/dbase/trunk/tests/dbase_add_record_variation1.phpt
===================================================================
--- pecl/dbase/trunk/tests/dbase_add_record_variation1.phpt	2016-10-30 12:37:58 UTC (rev 340798)
+++ pecl/dbase/trunk/tests/dbase_add_record_variation1.phpt	2016-10-30 13:01:47 UTC (rev 340799)
@@ -36,7 +36,7 @@
   [3]=>
   string(18) "19840501000000.000"
   [4]=>
-  int(1)
+  bool(true)
   [5]=>
   float(123.45)
   ["deleted"]=>
@@ -53,7 +53,7 @@
   [3]=>
   string(18) "19840501000000.000"
   [4]=>
-  int(1)
+  bool(true)
   [5]=>
   float(123.45)
   ["deleted"]=>

Modified: pecl/dbase/trunk/tests/dbase_add_record_variation2.phpt
===================================================================
--- pecl/dbase/trunk/tests/dbase_add_record_variation2.phpt	2016-10-30 12:37:58 UTC (rev 340798)
+++ pecl/dbase/trunk/tests/dbase_add_record_variation2.phpt	2016-10-30 13:01:47 UTC (rev 340799)
@@ -37,7 +37,7 @@
   ["RELEASED_X"]=>
   string(18) "19840501000000.000"
   ["SUPORTED"]=>
-  int(1)
+  bool(true)
   ["PRICE"]=>
   float(123.45)
   ["deleted"]=>
@@ -54,7 +54,7 @@
   ["RELEASED_X"]=>
   string(18) "19840501000000.000"
   ["SUPORTED"]=>
-  int(1)
+  bool(true)
   ["PRICE"]=>
   float(123.45)
   ["deleted"]=>

Modified: pecl/dbase/trunk/tests/dbase_delete_record_basic.phpt
===================================================================
--- pecl/dbase/trunk/tests/dbase_delete_record_basic.phpt	2016-10-30 12:37:58 UTC (rev 340798)
+++ pecl/dbase/trunk/tests/dbase_delete_record_basic.phpt	2016-10-30 13:01:47 UTC (rev 340799)
@@ -34,7 +34,7 @@
   [3]=>
   string(18) "19850525120000.000"
   [4]=>
-  int(0)
+  bool(false)
   [5]=>
   float(56.78)
   ["deleted"]=>

Modified: pecl/dbase/trunk/tests/dbase_get_record_basic.phpt
===================================================================
--- pecl/dbase/trunk/tests/dbase_get_record_basic.phpt	2016-10-30 12:37:58 UTC (rev 340798)
+++ pecl/dbase/trunk/tests/dbase_get_record_basic.phpt	2016-10-30 13:01:47 UTC (rev 340799)
@@ -29,7 +29,7 @@
   [3]=>
   string(18) "20010627235959.999"
   [4]=>
-  int(0)
+  bool(false)
   [5]=>
   float(0.9)
   ["deleted"]=>

Modified: pecl/dbase/trunk/tests/dbase_get_record_with_names_basic.phpt
===================================================================
--- pecl/dbase/trunk/tests/dbase_get_record_with_names_basic.phpt	2016-10-30 12:37:58 UTC (rev 340798)
+++ pecl/dbase/trunk/tests/dbase_get_record_with_names_basic.phpt	2016-10-30 13:01:47 UTC (rev 340799)
@@ -29,7 +29,7 @@
   ["RELEASED_X"]=>
   string(18) "19840501000000.000"
   ["SUPORTED"]=>
-  int(1)
+  bool(true)
   ["PRICE"]=>
   float(123.45)
   ["deleted"]=>

Modified: pecl/dbase/trunk/tests/dbase_pack_basic.phpt
===================================================================
--- pecl/dbase/trunk/tests/dbase_pack_basic.phpt	2016-10-30 12:37:58 UTC (rev 340798)
+++ pecl/dbase/trunk/tests/dbase_pack_basic.phpt	2016-10-30 13:01:47 UTC (rev 340799)
@@ -36,7 +36,7 @@
   [3]=>
   string(18) "20010627235959.999"
   [4]=>
-  int(0)
+  bool(false)
   [5]=>
   float(0.9)
   ["deleted"]=>

Modified: pecl/dbase/trunk/tests/dbase_replace_record_basic.phpt
===================================================================
--- pecl/dbase/trunk/tests/dbase_replace_record_basic.phpt	2016-10-30 12:37:58 UTC (rev 340798)
+++ pecl/dbase/trunk/tests/dbase_replace_record_basic.phpt	2016-10-30 13:01:47 UTC (rev 340799)
@@ -34,7 +34,7 @@
   [3]=>
   string(18) "19730101123456.789"
   [4]=>
-  int(0)
+  bool(false)
   [5]=>
   float(1234567.89)
   ["deleted"]=>

Modified: pecl/dbase/trunk/tests/dbase_replace_record_variation1.phpt
===================================================================
--- pecl/dbase/trunk/tests/dbase_replace_record_variation1.phpt	2016-10-30 12:37:58 UTC (rev 340798)
+++ pecl/dbase/trunk/tests/dbase_replace_record_variation1.phpt	2016-10-30 13:01:47 UTC (rev 340799)
@@ -37,7 +37,7 @@
   [3]=>
   string(18) "19840501000000.000"
   [4]=>
-  int(1)
+  bool(true)
   [5]=>
   float(123.45)
   ["deleted"]=>
@@ -54,7 +54,7 @@
   [3]=>
   string(18) "19840501000000.000"
   [4]=>
-  int(1)
+  bool(true)
   [5]=>
   float(12.34)
   ["deleted"]=>

Modified: pecl/dbase/trunk/tests/dbase_replace_record_variation2.phpt
===================================================================
--- pecl/dbase/trunk/tests/dbase_replace_record_variation2.phpt	2016-10-30 12:37:58 UTC (rev 340798)
+++ pecl/dbase/trunk/tests/dbase_replace_record_variation2.phpt	2016-10-30 13:01:47 UTC (rev 340799)
@@ -38,7 +38,7 @@
   ["RELEASED_X"]=>
   string(18) "19840501000000.000"
   ["SUPORTED"]=>
-  int(1)
+  bool(true)
   ["PRICE"]=>
   float(123.45)
   ["deleted"]=>
@@ -55,7 +55,7 @@
   ["RELEASED_X"]=>
   string(18) "19840501000000.000"
   ["SUPORTED"]=>
-  int(1)
+  bool(true)
   ["PRICE"]=>
   float(12.34)
   ["deleted"]=>

Modified: pecl/dbase/trunk/tests/type_logical.phpt
===================================================================
--- pecl/dbase/trunk/tests/type_logical.phpt	2016-10-30 12:37:58 UTC (rev 340798)
+++ pecl/dbase/trunk/tests/type_logical.phpt	2016-10-30 13:01:47 UTC (rev 340799)
@@ -7,7 +7,7 @@
 --FILE--
 <?php
 $db = dbase_create(
-    __DIR__ . DIRECTORY_SEPARATOR . 'dbase-logical.dbf',
+    __DIR__ . DIRECTORY_SEPARATOR . 'type_logical.dbf',
     array(
         array('flag', 'L')
     )
@@ -26,22 +26,22 @@
 ?>
 ===DONE===
 --EXPECT--
-int(1)
-int(1)
-int(1)
-int(1)
-int(0)
-int(0)
-int(0)
-int(0)
-int(0)
-int(0)
-int(0)
-int(0)
-int(0)
-int(0)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
 ===DONE===
 --CLEAN--
 <?php
-unlink(__DIR__ . DIRECTORY_SEPARATOR . 'dbase-logical.dbf');
+unlink(__DIR__ . DIRECTORY_SEPARATOR . 'type_logical.dbf');
 ?>



-- 
PECL CVS Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic