forked from xdebug/xdebug
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- One more opcode for bug xdebug#651: Incorrect code coverage after e…
…mpty() in conditional when using XDEBUG_CC_UNUSED. SVN Rev: 3388
- Loading branch information
Showing
4 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--TEST-- | ||
Test for bug #651: Incorrect code coverage after empty() in conditional | ||
--FILE-- | ||
<?php | ||
|
||
xdebug_start_code_coverage(XDEBUG_CC_UNUSED); | ||
|
||
function repeat($x) | ||
{ | ||
if ( empty($x) | ||
AND $x !== 1 | ||
AND $x !== 2 | ||
AND $x !== 3) | ||
{ | ||
$y = 'covered'; | ||
} | ||
} | ||
|
||
repeat(0); | ||
repeat(1); | ||
repeat(2); | ||
repeat(3); | ||
repeat(4); | ||
|
||
var_dump(xdebug_get_code_coverage()); | ||
?> | ||
--EXPECTF-- | ||
array(1) { | ||
["%sbug00651b.php"]=> | ||
array(15) { | ||
[5]=> | ||
int(1) | ||
[7]=> | ||
int(1) | ||
[8]=> | ||
int(1) | ||
[9]=> | ||
int(1) | ||
[10]=> | ||
int(1) | ||
[11]=> | ||
int(1) | ||
[12]=> | ||
int(1) | ||
[13]=> | ||
int(1) | ||
[14]=> | ||
int(1) | ||
[16]=> | ||
int(1) | ||
[17]=> | ||
int(1) | ||
[18]=> | ||
int(1) | ||
[19]=> | ||
int(1) | ||
[20]=> | ||
int(1) | ||
[22]=> | ||
int(1) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--TEST-- | ||
Test for bug #651: Incorrect code coverage after isset() in conditional | ||
--FILE-- | ||
<?php | ||
|
||
xdebug_start_code_coverage(XDEBUG_CC_UNUSED); | ||
|
||
function repeat($x) | ||
{ | ||
if ( isset($x) | ||
AND $x !== 1 | ||
AND $x !== 2 | ||
AND $x !== 3) | ||
{ | ||
$y = 'covered'; | ||
} | ||
} | ||
|
||
repeat(0); | ||
repeat(1); | ||
repeat(2); | ||
repeat(3); | ||
repeat(4); | ||
|
||
var_dump(xdebug_get_code_coverage()); | ||
?> | ||
--EXPECTF-- | ||
array(1) { | ||
["%sbug00651c.php"]=> | ||
array(15) { | ||
[5]=> | ||
int(1) | ||
[7]=> | ||
int(1) | ||
[8]=> | ||
int(1) | ||
[9]=> | ||
int(1) | ||
[10]=> | ||
int(1) | ||
[11]=> | ||
int(1) | ||
[12]=> | ||
int(1) | ||
[13]=> | ||
int(1) | ||
[14]=> | ||
int(1) | ||
[16]=> | ||
int(1) | ||
[17]=> | ||
int(1) | ||
[18]=> | ||
int(1) | ||
[19]=> | ||
int(1) | ||
[20]=> | ||
int(1) | ||
[22]=> | ||
int(1) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters