You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Martin Sebor <se...@roguewave.com> on 2008/06/24 21:45:53 UTC

Re: svn commit: r663373 - in /stdcxx/branches/4.2.x: include/valarray tests/numerics/26.gslice.array.cassign.cpp

vitek@apache.org wrote:
> Author: vitek
> Date: Wed Jun  4 13:53:00 2008
> New Revision: 663373
> 
> URL: http://svn.apache.org/viewvc?rev=663373&view=rev
> Log:
> 2008-06-04  Travis Vitek  <vi...@roguewave.com>
> 
[...]
> Added: stdcxx/branches/4.2.x/tests/numerics/26.gslice.array.cassign.cpp
> URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/numerics/26.gslice.array.cassign.cpp?rev=663373&view=auto
[...]
> +
> +        if (!repeat)
> +        {

Please correct the brace placement :)

> +            buf [i++] = std::size_t (val);
> +        }
> +        else
> +        {

Same here.

> +            const std::size_t n = buf [i-1];
[...]
> +template <class T>
> +void test_mul_assign (const T*, const char *tname, const char *opname)
> +{
> +    rw_info (0, 0, __LINE__,
> +             "std::gslice_array<%s>::operator%s (const std::valarray<%1$s>&)",
> +             tname, opname);
> +
> +    void (std::gslice_array<T>::*op)(const std::valarray<T>&) const =
> +        &std::gslice_array<T>::operator*=;

Please keep an eye on this test. Many older compilers tend
to have problems with taking the address of member functions
of class templates.

> +
[...]
> +int main (int argc, char *argv[])
> +{
> +    // FIXME: add command line options to enable/disable each operator

Seems this is done below, no?

> +    return rw_test (argc, argv, __FILE__,
> +                    "gslice.array.comp.assign",
> +                    0 /* no comment */,
> +                    run_test,
> +                    "|-times~ "
> +                    "|-divide~ "
> +                    "|-modulo~ "
> +                    "|-plus~ "
> +                    "|-minus~ "
> +                    "|-xor~ "
> +                    "|-and~ "
> +                    "|-or~ "
> +                    "|-shift_left~ "
> +                    "|-shift_right~",
> +                    opt_assign + inx_mul_assign,
> +                    opt_assign + inx_div_assign,
> +                    opt_assign + inx_mod_assign,
> +                    opt_assign + inx_add_assign,
> +                    opt_assign + inx_sub_assign,
> +                    opt_assign + inx_xor_assign,
> +                    opt_assign + inx_and_assign,
> +                    opt_assign + inx_or_assign,
> +                    opt_assign + inx_shl_assign,
> +                    opt_assign + inx_shr_assign,
> +                    (void*)0   /* sentinel */);
> +}
> \ No newline at end of file

Don't forget to add it (the missing newline).

Great test, btw.!

Martin