stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r581626 - /incubator/stdcxx/trunk/util/display.cpp
Date Wed, 03 Oct 2007 15:25:28 GMT
Author: faridz
Date: Wed Oct  3 08:25:27 2007
New Revision: 581626

URL: http://svn.apache.org/viewvc?rev=581626&view=rev
Log:
2007-10-03 Farid Zaripov <farid_zaripov@epam.com>

	* display.cpp (print_status_plain): Use float arithmetic when
	calculating the percent of the failed assertions to avoid
	overflow of the unsigned int type.

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

Modified: incubator/stdcxx/trunk/util/display.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/display.cpp?rev=581626&r1=581625&r2=581626&view=diff
==============================================================================
--- incubator/stdcxx/trunk/util/display.cpp (original)
+++ incubator/stdcxx/trunk/util/display.cpp Wed Oct  3 08:25:27 2007
@@ -205,8 +205,10 @@
         && 0 == status->status 
         && 0 == status->exit) {
         if (status->assert) {
-            printf (" %7u %6u %5d%%", status->assert, status->failed, 
-                    100 * (status->assert - status->failed) / status->assert);
+            const int percnt = int (  100.0
+                                    * (status->assert - status->failed)
+                                    / status->assert);
+            printf (" %7u %6u %5d%%", status->assert, status->failed, percnt);
         }
         else {
             printf ("       0 %6u   100%%", status->failed);



Mime
View raw message