changeset 219:2c43cdee5309

7901391: getRoughCount produces 10^-2147483648
author shade
date Thu, 16 Apr 2015 16:59:42 +0300
parents 5fcd4f948639
children ca8b9d9c06b7
files jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/HTMLReportPrinter.java
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/HTMLReportPrinter.java	Tue Mar 10 14:39:51 2015 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/HTMLReportPrinter.java	Thu Apr 16 16:59:42 2015 +0300
@@ -456,7 +456,7 @@
         cellStyle = 3 - cellStyle;
         output.println("<tr class=\"cell" + cellStyle + "\">");
         output.println("<td>&nbsp;&nbsp;&nbsp;<a href=\"" + result.getName() + ".html\">" + cutKlass(result.getName()) + "</a></td>");
-        output.printf("<td>> 10<sup>%d</sup></td>", getRoughCount(result));
+        output.printf("<td>%s</td>", getRoughCount(result));
         if (description != null) {
             TestGrading grading = new TestGrading(result, description);
             if (grading.isPassed) {
@@ -527,13 +527,17 @@
         output.println("</tr>");
     }
 
-    public static int getRoughCount(TestResult r) {
+    public static String getRoughCount(TestResult r) {
         long sum = 0;
         for (State s : r.getStates()) {
             sum += s.getCount();
         }
 
-        return (int) Math.floor(Math.log10(sum));
+        if (sum > 10) {
+            return "10<sup>" + (int) Math.floor(Math.log10(sum)) + "</sup>";
+        } else {
+            return String.valueOf(sum);
+        }
     }