]> granicus.if.org Git - php/commitdiff
Fixed division by zero warning.
authorIlia Alshanetsky <iliaa@php.net>
Fri, 16 Jan 2004 15:17:37 +0000 (15:17 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 16 Jan 2004 15:17:37 +0000 (15:17 +0000)
run-tests.php

index 96e52ec03ece52c1c6a784a842e88e18cae74267..e4dfad46e04e41ef745e170e632c098c530bec6f 100755 (executable)
@@ -1112,9 +1112,13 @@ function get_summary($show_ext_summary)
        global $exts_skipped, $exts_tested, $n_total, $sum_results, $percent_results, $end_time, $start_time, $failed_test_summary, $PHP_FAILED_TESTS;
 
        $x_total = $n_total - $sum_results['SKIPPED'] - $sum_results['BORKED'];
-       $x_warned = (100.0 * $sum_results['WARNED']) / $x_total;
-       $x_failed = (100.0 * $sum_results['FAILED']) / $x_total;
-       $x_passed = (100.0 * $sum_results['PASSED']) / $x_total;
+       if ($x_total) {
+               $x_warned = (100.0 * $sum_results['WARNED']) / $x_total;
+               $x_failed = (100.0 * $sum_results['FAILED']) / $x_total;
+               $x_passed = (100.0 * $sum_results['PASSED']) / $x_total;
+       } else {
+               $x_warned = $x_failed = $x_passed = 0;
+       }
 
        $summary = "";
        if ($show_ext_summary) {