You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Andrew Black <ab...@roguewave.com> on 2007/03/07 19:45:02 UTC
[PATCH] Re: --compat mode behavior issues
Greetings Martin, all.
Attached is a patch that partly rewrites the check_compat_test method,
taking the points raised below into consideration.
Changelog:
* 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
>
Re: [PATCH] Re: --compat mode behavior issues
Posted by Martin Sebor <se...@roguewave.com>.
Andrew Black wrote:
> Greetings Martin, all.
>
> Attached is a patch that partly rewrites the check_compat_test method,
> taking the points raised below into consideration.
>
> Changelog:
> * 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).
Looks okay except for the bool keyword. If we're still hoping
to someday compile the files with a C compiler we should avoid
using C++ keywords or constructs.
Martin