Skip to content

Commit 6ab02a9

Browse files
committed
ext/iconv: Remove bool type coercions in tests
1 parent 3a6984e commit 6ab02a9

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

ext/iconv/tests/bug48147.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ $text = "aa\xC3\xC3\xC3\xB8aa";
88
var_dump(iconv("UTF-8", "UTF-8", $text));
99
var_dump(urlencode(iconv("UTF-8", "UTF-8//IGNORE", $text)));
1010
// only invalid
11-
var_dump(urlencode(iconv("UTF-8", "UTF-8//IGNORE", "\xC3")));
11+
var_dump(iconv("UTF-8", "UTF-8//IGNORE", "\xC3"));
1212
// start invalid
1313
var_dump(urlencode(iconv("UTF-8", "UTF-8//IGNORE", "\xC3\xC3\xC3\xB8aa")));
1414
// finish invalid
15-
var_dump(urlencode(iconv("UTF-8", "UTF-8//IGNORE", "aa\xC3\xC3\xC3")));
15+
var_dump(iconv("UTF-8", "UTF-8//IGNORE", "aa\xC3\xC3\xC3"));
1616
?>
1717
--EXPECTF--
1818
Notice: iconv(): Detected an illegal character in input string in %s on line %d
1919
bool(false)
2020
string(10) "aa%C3%B8aa"
2121

2222
Notice: iconv(): Detected an incomplete multibyte character in input string in %s on line %d
23-
string(0) ""
23+
bool(false)
2424
string(8) "%C3%B8aa"
2525

2626
Notice: iconv(): Detected an incomplete multibyte character in input string in %s on line %d
27-
string(0) ""
27+
bool(false)

ext/iconv/tests/iconv_mime_decode.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ function do_single_test($header)
1717
global $mode;
1818

1919
$result = iconv_mime_decode($header, $mode, "UTF-8");
20-
printf("(%d) \"%s\"\n", iconv_strlen($result, "UTF-8"), $result);
20+
$len = $result ? iconv_strlen($result, "UTF-8") : 0;
21+
printf("(%d) \"%s\"\n", $len, $result);
2122
}
2223

2324
function do_regression_test()

ext/iconv/tests/iconv_stream_filter.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fclose($fp);
2222
$fp = fopen(__DIR__.'/iconv_stream_filter.txt', 'rb');
2323
stream_filter_append($fp, 'string.rot13'); // this will make conversion fail.
2424
stream_filter_append($fp, 'convert.iconv.ISO-2022-JP/EUC-JP');
25-
var_dump(bin2hex(@fread($fp, 10)) != "a4b3a4f3a4cba4c1a4cf");
25+
var_dump(bin2hex(fread($fp, 10)) != "a4b3a4f3a4cba4c1a4cf");
2626
var_dump(bin2hex(fread($fp, 5)) != "69636f6e76");
2727
var_dump(bin2hex(fread($fp, 1)) != "0a");
2828
fclose($fp);

0 commit comments

Comments
 (0)