incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: [PATCH] 23.list.iterators 23.list.cons tests with environment
Date Mon, 07 Aug 2006 23:36:38 GMT
Farid Zaripov wrote:
>   I have sent this letter to the stdcxx-dev@ at Friday, but its has not 
> reached, possible due to excess of a limit for the size of attachments.
> 
>   I resend this letter. The source files are here:
> http://zaripov.kiev.ua/src/
> 
> ------------------------------------------------------------------------
> ------
> 
>   The files attached is new tests of the list container with
> supporting files and changes to the existing files.
> 
> 
>   ChangeLog:
[...]
>     * 23.list.iterators.cpp: New test exercising the list members:
>     begin(), end(), rbegin(), rend(), front(), back(), get_allocator().

 > ------------------------------------------------------------------------
 >
 > 
/***************************************************************************
 > *
 > * 23.list.iterators.cpp - list test exercising lib.list.iterators
 > *
 > * $Id: 23.list.iterators.cpp
 > *
 > 
***************************************************************************
 > *
 > * Copyright 2006 The Apache Software Foundation or its licensors,
 > * as applicable.

Please use the new notice.

[...]
 > // used to exercise
 > // begin () and rend () and front ()
 > static const ContainerTestCase
 > begin_void_test_cases [] = {
 >
 > #undef TEST
 > #define TEST(lst, res) {                    \
 >     __LINE__, -1, -1, -1, -1, -1,           \
 >     lst, sizeof (lst) - 1,                  \
 >     0, 0, 0, res, 0                         \
 > }
 >
 >     //    +--------------------------------- controlled sequence
 >     //    |                +---------------- expected result
 >     //    |                |
 >     //    V                V
 >     TEST ("",              NPOS),

NPOS is specific to string. We should use a different name here
or simply -1 to denote the same thing.

 >     TEST ("a",             'a' ),
 >     TEST ("<U0>",          '\0'),

FWIW, there is no need to exercise any other containers with the
NUL character. We can just stick to the characters of the alphabet
since they are easier to read. (The reason NUL is important to the
string tests is to detect the reliance to the traditional C strxxx
functions which operate on NUL-terminated character strings and do
not permit embedded NULs).

[...]
 >
 > static inline char to_char(char c)
[...]
 > static inline char to_char(const X& x)

I would suggest renaming these to something like to_value() or
to_int() (as I mentioned previously, there's no reason to test
containers with chars).

[...]
 >             // const bool success = (1 == rw_match (&exp_res, 
res_ptr, 1));
 >             // due to bug in rw_match we can't compare the single 
characters

What bug is this? We should fix it.

Martin

Mime
View raw message