You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Farid Zaripov <Fa...@kyiv.vdiweb.com> on 2006/12/22 15:04:34 UTC
[PATCH] std::list container tests
The patch located here: http://zaripov.kiev.ua/src/tests.patch
The changelog will be posted later.
Farid.
Re: [PATCH] std::list container tests
Posted by Martin Sebor <se...@roguewave.com>.
Ping? I'm anxious to review this and get it in. Farid, can
you please post the ChangeLog to make the review easier?
Thanks
Martin
Martin Sebor wrote:
> Farid Zaripov wrote:
>> The patch located here: http://zaripov.kiev.ua/src/tests.patch
>>
>> The changelog will be posted later.
>
> Wow, this looks quite impressive! I haven't gone through the whole
> patch in great detail yet but it would be very helpful to have the
> changelog, especially to understand the changes to 21.string.{h,cpp}.
> Looks like you did some refactoring there -- I think I like it! :)
>
> Do all the tests pass? (AFAIK, we have a conformance bug in splice
> that the tests should detect).
>
> Thanks
> Martin
Re: [PATCH] std::list container tests
Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
> The patch located here: http://zaripov.kiev.ua/src/tests.patch
>
> The changelog will be posted later.
Wow, this looks quite impressive! I haven't gone through the whole
patch in great detail yet but it would be very helpful to have the
changelog, especially to understand the changes to 21.string.{h,cpp}.
Looks like you did some refactoring there -- I think I like it! :)
Do all the tests pass? (AFAIK, we have a conformance bug in splice
that the tests should detect).
Thanks
Martin
RE: [PATCH] std::list container tests
Posted by Farid Zaripov <Fa...@kyiv.vdiweb.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com]
> Sent: Monday, January 22, 2007 1:28 AM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: [PATCH] std::list container tests
>
> This should be removed from rw_value.h:
>
> +/*
> +template <class Iter>
> +static _RWSTD_SIZE_T
> +UserPOD::mismatch (Iter it, const char* str, _RWSTD_SIZE_T len =
> _RWSTD_SIZE_MAX)
Ok.
> Shouldn't these functions be declared static?
>
> +// add a bunch of toggle-type command line options based on
> the names
> +array void _rw_add_toggles (char **pbuf, size_t *pbufsize,
> + const char* const names[], size_t count) {
> +
> +void _rw_add_container_toggles (char **pbuf, size_t *pbufsize) {
Yes. I thought it good to use _rw_add_toggles defined in
21.strings.cpp.
Farid.
Re: [PATCH] std::list container tests
Posted by Martin Sebor <se...@roguewave.com>.
Martin Sebor wrote:
> Farid Zaripov wrote:
[...]
>>> The patch located here: http://zaripov.kiev.ua/src/tests.patch
A couple of comments on the patch itself...
This should be removed from rw_value.h:
+/*
+template <class Iter>
+static _RWSTD_SIZE_T
+UserPOD::mismatch (Iter it, const char* str, _RWSTD_SIZE_T len =
_RWSTD_SIZE_MAX)
+{
+ if (!str)
+ return xarray;
+
+ if (size_t (-1) == len)
+ len = strlen (str);
+
+ for (size_t i = 0; i != len; ++i) {
+
+ const int val = UChar (str [i]);
+
+ if (val != xarray [i].val_)
+ return xarray + i;
+ }
+
+ return 0;
+}
+*/
Shouldn't these functions be declared static?
+// add a bunch of toggle-type command line options based on the names array
+void
+_rw_add_toggles (char **pbuf, size_t *pbufsize,
+ const char* const names[], size_t count)
+{
+ for (size_t i = 0; i != count; ++i) {
+ rw_asnprintf (pbuf, pbufsize, "%{+}|-%s~ ", names [i]);
+ }
+}
+
+void _rw_add_container_toggles (char **pbuf, size_t *pbufsize)
+{
+ _rw_add_toggles (pbuf, pbufsize, _rw_alloc_names, _rw_n_allocs);
+ _rw_add_toggles (pbuf, pbufsize, _rw_iter_names + 1, _rw_n_iters - 1);
+}
+
Martin
RE: [PATCH] std::list container tests
Posted by Farid Zaripov <Fa...@kyiv.vdiweb.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com]
> Sent: Monday, January 22, 2007 1:09 AM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: [PATCH] std::list container tests
>
> Thanks. I've spent some time going through the patch and while
> I still like your changes I'm not completely comfortable with
> their extent or with lumping them all together.
[...]
Ok. I'll prepare set of separate patches.
Farid.
Re: [PATCH] std::list container tests
Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Farid Zaripov [mailto:FaridZ@kyiv.vdiweb.com]
>> Sent: Friday, December 22, 2006 4:05 PM
>> To: stdcxx-dev@incubator.apache.org
>> Subject: [PATCH] std::list container tests
>>
>> The patch located here: http://zaripov.kiev.ua/src/tests.patch
>>
>> The changelog will be posted later.
>
> The changelog:
Thanks. I've spent some time going through the patch and while
I still like your changes I'm not completely comfortable with
their extent or with lumping them all together. For instance
the renaming of class X and separating it from <alg_test.h>
into a header of its own, while a good change, should be done
in a separate patch, ideally with a transitional typedef for
X to make it possible to commit the patch without touching
all the tests that use X. Another patch should then change
the tests to use the new name(s) and remove the transitional
typedef.
So for starters, I would like to see the patch broken up into
as many smaller ones as reasonable. Changes that are logically
independent of all others (e.g., the renaming of symbols)
should be made separately, ideally with some transitional
solution in place (as I described above).
Changes to the iterator helper templates (ConstFwdIter etc.)
should also be made separately.
If you are moving things from one header or source to another
it's good to do the move without making any other changes so
as to make it possible to review each types of changes
separately (otherwise there's no easy way to tell that in
addition to moving a class to a new header you also changed
some of its members).
Also, it will be better and cleaner (and easier to review) to
first make all the test driver changes and add the new tests
only when the driver is done.
Other than these general issues, please make sure to use the
appropriate macros (e.g., _RWSTD_SIZE_T, or _TRY and _CATCH)
rather than the actual C++ constructs to make the code easily
portable to older platforms.
Also, I notice you changed the comment describing the
is_sorted_lt template from
// returns true iff a sequence of values
to
// returns true if a sequence of values
The "iff" is not a typo, it's a shorthand for "IF and only iF."
Thanks
Martin
RE: [PATCH] std::list container tests
Posted by Farid Zaripov <Fa...@kyiv.vdiweb.com>.
> -----Original Message-----
> From: Farid Zaripov [mailto:FaridZ@kyiv.vdiweb.com]
> Sent: Friday, December 22, 2006 4:05 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: [PATCH] std::list container tests
>
> The patch located here: http://zaripov.kiev.ua/src/tests.patch
>
> The changelog will be posted later.
The changelog:
* rw_sigdefs.h: New header file with definitions of helpers macros
to define member and non-member functions overload id's
* 23.containers.h: New header file with definitions of helpers
used in clause 23 tests.
* 23.containers.cpp: Ditto.
* 21.strings.h: #included 23.containers.h. StringIds inherited from
ContainerIds. Removed definitions, which is present in
23.containers.h.
(rw_setvars): Declaration removed
* 21.strings.cpp: Removed definitions, which is present
in 23.containers.h.
(rw_setvars): Renamed to _rw_setvars, fixed format string
* rw_value.h: New file with declarations of the user defined class
and POD types
* value.cpp: New file with definitions UserClass and UserPOD members
* alg_test.h: struct X renamed to UserClass and moved to rw_value.h.
UnaryPredicate and BinaryPredicate moved to rw_value.h.
ConstFwdIter<T> inherited from FwdIter<const T>.
ConstBidirIter<T> inherited from BidirIter<const T>.
ConstRandomAccessIter<T> inherited from RandomAccessIter<const T>.
(make_iter): type of the last parameter changed to const reference
* alg_test.cpp (_rw_fmtxarrayv): Moved to value.cpp.
struct X members renamed to UserClass members and moved to
value.cpp.
UnaryPredicate and BinaryPredicate mebmers moved to value.cpp.
* 23.list.h: New header file with definitions of helpers used
in clause 23.list tests.
* 23.list.iterators.cpp: New test exercising the list members:
begin(), end(), rbegin(), rend(), front(), back(), get_allocator().
* 23.list.cons.cpp: New test exercising list constructors and
list<>::operator=.
* 23.list.assign.cpp: New test exercising the assign() method.
* 23.list.capacity.cpp: New test exercising the list mebmers:
size(), max_size(), resize(), clear(), empty().
* 23.list.erase.cpp: New test exercising the list mebmers:
erase(), pop_front(), pop_back().
* 23.list.insert.cpp: New test exercising the list mebmers:
insert(), push__front(), push_back().
* 23.list.special.cpp: New test exercising the swap() method.
Farid.