diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-12-05 18:47:38 -0500 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-12-05 18:47:38 -0500 |
commit | 6682b0880c9c5f25e81f5e9670a010a14cfe1f68 (patch) | |
tree | 8ee744827574411be388a4c5a52f5f9a70573257 /pts-core/objects/pts_test_result.php | |
parent | 05eed2c85cc0d875bedf915b0cf238477a0c9400 (diff) | |
download | phoronix-test-suite-upstream-6682b0880c9c5f25e81f5e9670a010a14cfe1f68.tar.gz phoronix-test-suite-upstream-6682b0880c9c5f25e81f5e9670a010a14cfe1f68.tar.xz phoronix-test-suite-upstream-6682b0880c9c5f25e81f5e9670a010a14cfe1f68.zip |
pts-core: Various fixes to the rewritten run_test
Diffstat (limited to 'pts-core/objects/pts_test_result.php')
-rw-r--r-- | pts-core/objects/pts_test_result.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/pts-core/objects/pts_test_result.php b/pts-core/objects/pts_test_result.php index adcc3b9..2bc5b86 100644 --- a/pts-core/objects/pts_test_result.php +++ b/pts-core/objects/pts_test_result.php @@ -192,15 +192,21 @@ class pts_test_result { // assume AVG (average) $TOTAL_RESULT = 0; + $TOTAL_COUNT = 0; + foreach($this->trial_results as $result) { - $TOTAL_RESULT += trim($result); - $return_string .= $result . " " . $this->result_scale . "\n"; + if(is_numeric($result)) + { + $TOTAL_RESULT += trim($result); + $TOTAL_COUNT++; + $return_string .= $result . " " . $this->result_scale . "\n"; + } } - if(count($this->trial_results) > 0) + if($TOTAL_COUNT > 0) { - $END_RESULT = pts_trim_double($TOTAL_RESULT / count($this->trial_results), 2); + $END_RESULT = pts_trim_double($TOTAL_RESULT / $TOTAL_COUNT, 2); } else { |