Skip to content

Commit c4e4e98

Browse files
committed
#19: await/018-awaitAll_double_free.phpt - test stabilization
1 parent 2b374ba commit c4e4e98

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/await/018-awaitAll_double_free.phpt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,26 @@ for ($i = 1; $i <= 100; $i++) {
2121

2222
$results = awaitAll($coroutines);
2323

24+
// Check that we got all results
25+
$countOfResults = count($results) == 100 ? "OK" : "FALSE: ".count($results);
26+
echo "Count of results: $countOfResults\n";
27+
28+
// Check that results are not null
29+
$nonNullCount = 0;
2430
foreach ($results as $result) {
31+
if ($result !== null) {
32+
$nonNullCount++;
33+
}
2534
unset($result); // intentionally unset to trigger double free
2635
}
2736

37+
$nonNullResults = $nonNullCount == 100 ? "OK" : "FALSE: $nonNullCount";
38+
echo "Non-null results: $nonNullResults\n";
39+
2840
echo "end\n";
2941
?>
3042
--EXPECT--
3143
start
44+
Count of results: OK
45+
Non-null results: OK
3246
end

0 commit comments

Comments
 (0)