php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #80018
Patch 0001-Tolerate-var_dump-printing-floats-in-exponential-not.patch revision 2020-08-25 20:52 UTC by jamieliu at google dot com
revision 2020-08-25 20:09 UTC by jamieliu at google dot com

Patch 0001-Tolerate-var_dump-printing-floats-in-exponential-not.patch for Testing related Bug #80018

Patch version 2020-08-25 20:52 UTC

Return to Bug #80018 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions: 2020-08-25 20:52 UTC | 2020-08-25 20:09 UTC

Developer: jamieliu@google.com


 From 948b2db4aa0d48fc50491c12f8ee3439a00acc19 Mon Sep 17 00:00:00 2001
 From 09e784665c61f639a9ac0b3b66fb53f3fc9c646a Mon Sep 17 00:00:00 2001
  From: Jamie Liu <jamieliu@google.com>
 Date: Tue, 25 Aug 2020 10:59:34 -0700
 Date: Tue, 25 Aug 2020 13:39:43 -0700
  Subject: [PATCH] Tolerate var_dump() printing floats in exponential notation
   in tests.
  
  ---


   .../tests/general_functions/type.phpt         |  6 ++--
   11 files changed, 49 insertions(+), 49 deletions(-)
  
  diff --git a/Zend/tests/cast_to_double.phpt b/Zend/tests/cast_to_double.phpt
 index 6151c00f84b8..244971960ddc 100644
 index 6151c00f84b8..58286436bd29 100644
  --- a/Zend/tests/cast_to_double.phpt
  +++ b/Zend/tests/cast_to_double.phpt
  @@ -50,7 +50,7 @@ float(1)
   float(0)
   float(1)
   float(0)
  -float(%d)
 +float(%E)
 +float(%f)
   
   Notice: Object of class test could not be converted to float in %s on line %d
   float(1)
  diff --git a/Zend/tests/settype_double.phpt b/Zend/tests/settype_double.phpt
 index 8c74a95b14c2..3cadebff2715 100644
 index 8c74a95b14c2..d5b2f0e42ea9 100644
  --- a/Zend/tests/settype_double.phpt
  +++ b/Zend/tests/settype_double.phpt
  @@ -50,7 +50,7 @@ float(1)
   float(0)
   float(1)
   float(0)
  -float(%d)
 +float(%E)
 +float(%f)
   
   Notice: Object of class test could not be converted to float in %s on line %d
   float(1)
  diff --git a/ext/standard/tests/file/disk.phpt b/ext/standard/tests/file/disk.phpt
 index 424de1f6ba8a..65690bf66f80 100644
 index 424de1f6ba8a..359b2c02b9b7 100644
  --- a/ext/standard/tests/file/disk.phpt
  +++ b/ext/standard/tests/file/disk.phpt
  @@ -30,8 +30,8 @@ bool(false)
   
   Warning: disk_total_space(): No such file or directory in %s on line %d
   bool(false)
  -float(%d)
  -float(%d)
 +float(%E)
 +float(%E)
 +float(%f)
 +float(%f)
   
   Warning: disk_free_space(): No such file or directory in %s on line %d
   bool(false)
  diff --git a/ext/standard/tests/file/disk_free_space_basic.phpt b/ext/standard/tests/file/disk_free_space_basic.phpt
 index 29b2cefed90b..8e09e70e30bc 100644
 index 29b2cefed90b..1590b71123f9 100644
  --- a/ext/standard/tests/file/disk_free_space_basic.phpt
  +++ b/ext/standard/tests/file/disk_free_space_basic.phpt
  @@ -50,18 +50,18 @@ rmdir($file_path."/disk_free_space");
   ?>
   --EXPECTF--
   *** Testing with existing directory ***
  -float(%d)
  -float(%d)
 +float(%E)
 +float(%E)
 +float(%f)
 +float(%f)
   *** Testing with newly created directory ***
    
    Free Space before writing to a file
  -float(%d)
 +float(%E)
 +float(%f)
   
    Free Space after writing to a file
  -float(%d)
 +float(%E)
 +float(%f)
   
    Free Space Value Is Correct
   *** Testing with Binary Input ***
  -float(%d)
 +float(%E)
 +float(%f)
   
   --- Done ---
  diff --git a/ext/standard/tests/file/disk_free_space_error.phpt b/ext/standard/tests/file/disk_free_space_error.phpt
 index 62dd8c40eea9..5df90376205f 100644
 index 62dd8c40eea9..3bec04bb814b 100644
  --- a/ext/standard/tests/file/disk_free_space_error.phpt
  +++ b/ext/standard/tests/file/disk_free_space_error.phpt
  @@ -35,7 +35,7 @@ bool(false)
   
   Warning: diskfreespace(): No such file or directory in %s on line %d
   bool(false)
  -float(%d)
  -float(%d)
 +float(%E)
 +float(%E)
 +float(%f)
 +float(%f)
   
   -- Done --
  diff --git a/ext/standard/tests/file/disk_free_space_variation.phpt b/ext/standard/tests/file/disk_free_space_variation.phpt
 index d5adb3221381..22a36a861fc4 100644
 index d5adb3221381..b68bd34211dd 100644
  --- a/ext/standard/tests/file/disk_free_space_variation.phpt
  +++ b/ext/standard/tests/file/disk_free_space_variation.phpt
  @@ -63,44 +63,44 @@ rmdir($file_path."/disk_free_space_variation");
   ?>
   --EXPECTF--
   *** Testing with a directory ***
  -float(%d)
  -float(%d)
 +float(%E)
 +float(%E)
 +float(%f)
 +float(%f)
   
   Testing for the return type ***
   bool(true)
   
   *** Testing with different directory combinations ***
   -- Iteration 1 --
  -float(%d)
  -float(%d)
 +float(%E)
 +float(%E)
 +float(%f)
 +float(%f)
   
   -- Iteration 2 --
  -float(%d)
  -float(%d)
 +float(%E)
 +float(%E)
 +float(%f)
 +float(%f)
   
   -- Iteration 3 --
  -float(%d)
  -float(%d)
 +float(%E)
 +float(%E)
 +float(%f)
 +float(%f)
   
   -- Iteration 4 --
  -float(%d)
  -float(%d)
 +float(%E)
 +float(%E)
 +float(%f)
 +float(%f)
   
   -- Iteration 5 --
  -float(%d)
  -float(%d)
 +float(%E)
 +float(%E)
 +float(%f)
 +float(%f)
   
   -- Iteration 6 --
  -float(%d)
  -float(%d)
 +float(%E)
 +float(%E)
 +float(%f)
 +float(%f)
   
   -- Iteration 7 --
  -float(%d)
  -float(%d)
 +float(%E)
 +float(%E)
 +float(%f)
 +float(%f)
   
   -- Iteration 8 --
  -float(%d)
  -float(%d)
 +float(%E)
 +float(%E)
 +float(%f)
 +float(%f)
   
   -- Iteration 9 --
   disk_free_space(): Argument #1 ($directory) must be a valid path, string given
  diff --git a/ext/standard/tests/file/disk_total_space_basic.phpt b/ext/standard/tests/file/disk_total_space_basic.phpt
 index 0bb6159a40e1..7f2fad26ecbf 100644
 index 0bb6159a40e1..e565527d8814 100644
  --- a/ext/standard/tests/file/disk_total_space_basic.phpt
  +++ b/ext/standard/tests/file/disk_total_space_basic.phpt
  @@ -32,11 +32,11 @@ rmdir($file_path."/disk_total_space");
   ?>
   --EXPECTF--
   *** Testing with normal directory ***
  -float(%d)
 +float(%E)
 +float(%f)
   *** Testing with newly created directory ***
  -float(%d)
 +float(%E)
 +float(%f)
   
   Total Space after writing to a file
  -float(%d)
 +float(%E)
 +float(%f)
   
   -- Done --
  diff --git a/ext/standard/tests/file/disk_total_space_error.phpt b/ext/standard/tests/file/disk_total_space_error.phpt
 index e4bd31fa5d97..8ae47de45613 100644
 index e4bd31fa5d97..88e6252adf95 100644
  --- a/ext/standard/tests/file/disk_total_space_error.phpt
  +++ b/ext/standard/tests/file/disk_total_space_error.phpt
  @@ -31,6 +31,6 @@ unlink($file_path."/disk_total_space.tmp");
   
   Warning: disk_total_space(): No such file or directory in %s on line %d
   bool(false)
  -float(%d)
 +float(%E)
 +float(%f)
   
   --- Done ---
  diff --git a/ext/standard/tests/file/disk_total_space_variation.phpt b/ext/standard/tests/file/disk_total_space_variation.phpt
 index da09238ecca2..3967a8d7f529 100644
 index da09238ecca2..a7578c486e0d 100644
  --- a/ext/standard/tests/file/disk_total_space_variation.phpt
  +++ b/ext/standard/tests/file/disk_total_space_variation.phpt
  @@ -64,35 +64,35 @@ rmdir($file_path."/disk_total_space");
   ?>
   --EXPECTF--
   *** Testing with a directory ***
  -float(%d)
 +float(%E)
 +float(%f)
   
   Testing for the return type ***
   bool(true)
   
   *** Testing with different directory combinations ***
   -- Iteration 1 --
  -float(%d)
 +float(%E)
 +float(%f)
   
   -- Iteration 2 --
  -float(%d)
 +float(%E)
 +float(%f)
   
   -- Iteration 3 --
  -float(%d)
 +float(%E)
 +float(%f)
   
   -- Iteration 4 --
  -float(%d)
 +float(%E)
 +float(%f)
   
   -- Iteration 5 --
  -float(%d)
 +float(%E)
 +float(%f)
   
   -- Iteration 6 --
  -float(%d)
 +float(%E)
 +float(%f)
   
   -- Iteration 7 --
  -float(%d)
 +float(%E)
 +float(%f)
   
   -- Iteration 8 --
  -float(%d)
 +float(%E)
 +float(%f)
   
   -- Iteration 9 --
   disk_total_space(): Argument #1 ($directory) must be a valid path, string given
  diff --git a/ext/standard/tests/general_functions/gettype_settype_basic.phpt b/ext/standard/tests/general_functions/gettype_settype_basic.phpt
 index 932ed7a9671b..db0a4dbb2d4f 100644
 index 932ed7a9671b..0c336f8a2367 100644
  --- a/ext/standard/tests/general_functions/gettype_settype_basic.phpt
  +++ b/ext/standard/tests/general_functions/gettype_settype_basic.phpt
  @@ -348,11 +348,11 @@ float(0)
   string(6) "double"
   -- Iteration 12 --
   bool(true)
  -float(%d)
 +float(%E)
 +float(%f)
   string(6) "double"
   -- Iteration 13 --
   bool(true)
  -float(%d)
 +float(%E)
 +float(%f)
   string(6) "double"
   -- Iteration 14 --
   8: Object of class point could not be converted to float
  @@ -407,11 +407,11 @@ float(0)
   string(6) "double"
   -- Iteration 12 --
   bool(true)
  -float(%d)
 +float(%E)
 +float(%f)
   string(6) "double"
   -- Iteration 13 --
   bool(true)
  -float(%d)
 +float(%E)
 +float(%f)
   string(6) "double"
   -- Iteration 14 --
   8: Object of class point could not be converted to float
  diff --git a/ext/standard/tests/general_functions/type.phpt b/ext/standard/tests/general_functions/type.phpt
 index a32e4b44a1d0..1e991436c8b9 100644
 index a32e4b44a1d0..a43640f09eba 100644
  --- a/ext/standard/tests/general_functions/type.phpt
  +++ b/ext/standard/tests/general_functions/type.phpt
  @@ -132,12 +132,12 @@ float(0)
   bool(true)
   float(0)
   bool(true)
  -float(%d)
 +float(%E)
 +float(%f)
   bool(true)
  -float(%d)
 +float(%E)
 +float(%f)
   string(56) "Object of class stdClass could not be converted to float"
   bool(true)
  -float(%d)
 +float(%E)
 +float(%f)
   bool(true)
   bool(true)
   bool(true)
  -- 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 01:01:30 2024 UTC