stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abl...@apache.org
Subject svn commit: r516188 - /incubator/stdcxx/trunk/util/output.cpp
Date Thu, 08 Mar 2007 21:43:34 GMT
Author: ablack
Date: Thu Mar  8 13:43:33 2007
New Revision: 516188

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

	* util/output.cpp (check_compat_test): Rewrite FSM to eliminate seek 
	to near end (was causing parsing issues on tests with output 
	following result block).


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

Modified: incubator/stdcxx/trunk/util/output.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/output.cpp?view=diff&rev=516188&r1=516187&r2=516188
==============================================================================
--- incubator/stdcxx/trunk/util/output.cpp (original)
+++ incubator/stdcxx/trunk/util/output.cpp Thu Mar  8 13:43:33 2007
@@ -145,9 +145,7 @@
     assert (0 != data);
     assert (0 != status);
 
-    fseek (data, -70, SEEK_END); /* Seek near the end of the file */
-
-    for (tok = fgetc (data); fsm < 4 && !feof (data); tok = fgetc (data)) {
+    for (tok = fgetc (data); !feof (data); tok = fgetc (data)) {
         switch (tok) {
         case '\n':
             fsm = 1;
@@ -159,20 +157,20 @@
                 fsm = 0;
             break;
         case ' ':
-            if (3 == fsm) {
+            if (3 == fsm) 
                 ++fsm;
-                break;
-            }
+            else
+                fsm = 0;
+            break;
+        case 'W':
+            if (4 == fsm && !feof (data)) /* leading "## W" eaten */
+                read = fscanf (data, "arnings = %u\n## Assertions = %u\n"
+                       "## FailedAssertions = %u",
+                       &status->t_warn, &status->assert, &status->failed);
         default:
             fsm = 0;
         }
     }
-    if (!feof (data)) { /* leading "## W" eaten above */
-        read = fscanf (data, "arnings = %u\n## Assertions = %u\n"
-                       "## FailedAssertions = %u",
-                       &status->t_warn, &status->assert, &status->failed);
-    }
-
     if (3 != read) {
         status->status = ST_FORMAT;
     }



Mime
View raw message