incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Black <>
Subject [PATCH] Re: --compat mode behavior issues
Date Wed, 07 Mar 2007 18:45:02 GMT
Greetings Martin, all.

Attached is a patch that partly rewrites the check_compat_test method, 
taking the points raised below into consideration.

	* 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).

Martin Sebor wrote:
> Andrew Black wrote:
>> One probable reason is that some legacy tests (like 27_iosfile) 
>> produce multiple assertion totals (or are supposed to), and we want 
>> the last of these, rather than the first.
> To handle this case we should process the file from the beginning
> and take the last total as the final one.
>> A second possible reason was to make the parsing FSM slightly simpler 
>> (though adding an additional character or two to the pattern shouldn't 
>> make it much more complex).
> I don't think avoiding the seek would add too much complexity
> (the default non-compat case doesn't seek and it's no more
> complex than the compat mode).
>> A final possible reason was to make the parsing faster for long output 
>> files.
> If the common case is the default mode (i.e., not --compat)
> we optimized the wrong branch :) In any case, getting correct
> results slowly is better than getting the wrong results fast.
> I suggest you rewrite check_compat_test() to avoid seeking
> and scan the whole file, top to bottom, and take the last
> total.
> Martin

View raw message