incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject Re: svn commit: r395448 - in /incubator/stdcxx/trunk/tests: include/21.strings.h src/21.strings.cpp
Date Fri, 21 Apr 2006 01:15:54 GMT
Martin Sebor wrote:
> Anton Pevtsov wrote:
>> And I have several questions:
>> 1) Does the TestCase structure contain enough members to test all
>> methods? For some of them off1, size1, off2 and size2 are required
>> simultaneously. Also the result may be an integer.
> No, it doesn't, not yet. It will need to be augmented to take
> this into account.

I added these to the 21.strings.h header and modified the append
and assign tests but I didn't have time to see if the changes are
enough to accommodate the replace test.

>> 2) May be it would be useful to include the "const char* method_name"
>> member into Test structure to eliminate additional code from the format
>> method? For example, each test may declare its name as a static
>> characters array in the beginning and initialize the method_name
>> structure with pointer to it. Or even add const char* method_name
>> directly into the StringMembers structure.
> Yes, I have been thinking about what else should go in there.
> Probably not the method_name (to avoid data bloat) but something
> like it might be a good idea (e.g., the MemberFunction enum that
> the formatter would map into the function name and signature).

I haven't done this yet but currently I'm thinking about replacing
the whole format() function with a general formatting directive
that will take the same arguments (i.e., the charT, Traits, and
Allocator enums and a pointer to the TestCase structure) and do
the formatting directly. In addition, I'm thinking about adding
another directive (or enhancing the same one) to format just the
name of the member function (e.g., "assign") and another to format
its signature (e.g., "assign(const value_type*, size_type)"), and
another still to format the name the of the container (e.g.,
"std::string", or "std::basic_string<...>", etc.)

This is just so you know what's coming. Let me know what you
think about it and/or if you have any questions or suggestions.


View raw message