stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abl...@apache.org
Subject svn commit: r483551 - in /incubator/stdcxx/trunk/util: display.cpp output.cpp
Date Thu, 07 Dec 2006 17:03:33 GMT
Author: ablack
Date: Thu Dec  7 09:03:32 2006
New Revision: 483551

URL: http://svn.apache.org/viewvc?view=rev&rev=483551
Log:
2006-12-07  Andrew Black  <ablack@roguewave.com>

	* output.cpp (check_test): Set status->status to ST_OVERFLOW if 
	status->assert equals -1, don't return when status->t_warn reaches -1.
	(check_example): Set status->assert to -1 to denote example.
	* display.cpp (print_status_plain): Output assertion totals if 
	status->assert isn't -1 and status->status and status->exit are 0,
	special case status->assert = 0 to avoid divide by 0 errors.

Modified:
    incubator/stdcxx/trunk/util/display.cpp
    incubator/stdcxx/trunk/util/output.cpp

Modified: incubator/stdcxx/trunk/util/display.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/display.cpp?view=diff&rev=483551&r1=483550&r2=483551
==============================================================================
--- incubator/stdcxx/trunk/util/display.cpp (original)
+++ incubator/stdcxx/trunk/util/display.cpp Thu Dec  7 09:03:32 2006
@@ -76,9 +76,16 @@
     printf (" %4u", status->c_warn + status->l_warn + status->t_warn);
 
     /* Print assetions, if any registered */
-    if (status->assert) {
-        printf (" %7u %6u %5d%%", status->assert, status->failed, 
-                100 * (status->assert - status->failed) / status->assert);
+    if (   (unsigned)-1 != status->assert
+        && 0 == status->status 
+        && 0 == status->exit) {
+        if (status->assert) {
+            printf (" %7u %6u %5d%%", status->assert, status->failed, 
+                    100 * (status->assert - status->failed) / status->assert);
+        }
+        else {
+            printf ("       0 %6u   100%%", status->failed);
+        }
     }
     else if (valid_timing || status->wall)
         printf ("                      ");

Modified: incubator/stdcxx/trunk/util/output.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/output.cpp?view=diff&rev=483551&r1=483550&r2=483551
==============================================================================
--- incubator/stdcxx/trunk/util/output.cpp (original)
+++ incubator/stdcxx/trunk/util/output.cpp Thu Dec  7 09:03:32 2006
@@ -104,7 +104,9 @@
                     r_active = r_total-r_active;
                 status->failed += r_active;
                 status->assert += r_total;
-                if (status->failed < r_active || status->assert < r_total) {
+                if (   status->failed < r_active 
+                    || status->assert < r_total
+                    || (unsigned int)-1 == status->assert) {
                     status->status = ST_OVERFLOW;
                     return;
                 }
@@ -113,7 +115,6 @@
                 status->t_warn += r_active;
                 if (status->t_warn < r_active) {
                     status->t_warn = (unsigned int)-1;
-                    return;
                 }
             }
             fmt_ok = 1;
@@ -215,6 +216,9 @@
     assert (0 != out_name);
     assert (0 != fout);
     assert (0 != status);
+
+    /* Mark as an example by setting assertions to -1 */
+    status->assert = (unsigned)-1;
 
     /* Try data_dir/manual/out/target_name.out */
     ref_name = reference_name (data_dir, "manual", "out");



Mime
View raw message