incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Vitek" <Travis.Vi...@roguewave.com>
Subject RE: svn commit: r667638 - /stdcxx/branches/4.3.x/tests/utilities/20.forward.cpp
Date Mon, 16 Jun 2008 15:45:40 GMT

I realize that this is a first 'draft', but I'll provide feedback now to
Help things move along.


elemings wrote:
> 
> + *
> + * Copyright 1994-2008 Rogue Wave Software.
> + * 
> 

The copyright is wrong. Martin has mentioned recently that the copyright
can't start before the code in question was written. I believe it should
be

  Copyright 2008 Rogue Wave Software, Inc.


elemings wrote:
> 
> +
> +static void
> +test_identity ()
> +{
> +    rw_info (0, __FILE__, __LINE__, "std::identity<T> class
template");
> +
> 

We ususally don't use the __FILE__ tag with code that is in the original
test file. I'm not exactly sure why, but I don't recall ever seeing it
used.
Perhaps this is to reduce the amount of output generated in the output
files?

Another thing to note is that most of the stdcxx tests don't display
anything other than the header when they run, unless something fails.
AFAICT, the ones that do are those that have been migrated from
perforce. In
a recent change, Martin actually removed the informational messages from
one
test [http://tinyurl.com/6dg2xf]


elemings wrote:
> 
> +    int i = 1;
> +    FooIdent foo_ident;
> +    Foo foo = foo_ident (i);
> +
> 

Shouldn't this check the signature of operator() and verifty that it
returns
the input parameter?


elemings wrote:
> 
> +
> +static int
> +run_test (int /*unused*/, char* /*unused*/ [])
> +{
> 

We usually omit the parameter names entirely. I don't think I've ever
seen
any stdcxx code that comments them out.


elemings wrote:
> 
> +#else // no rvalue references
> +
> +    rw_info (true, __FILE__, __LINE__,
> +             "No compiler support for rvalue references; tests
> disabled.");
> 

Shouldn't the first parameter be 0, which is consistent with the
expected
type of the first argument and will cause the informational message to
always be displayed. It is also consistent with the other rw_info()
calls
you use in the same file.


elemings wrote:
> 
> +
> +#endif   // !defined _RWSTD_NO_RVALUE_REFERENCES
> +
> +    return 0;
> +}
> +
> +/*extern*/ int
> +main (int argc, char* argv [])
> +{
> +    return rw_test (argc, argv, __FILE__,
> +                    "[forward]", "20.2.2  forward/move helpers",
> 

I think we use the name of the section of the standard being tested
without
the brackets. Also, we should avoid using the section number as it is
likely
to change with every revision of the standard.

Travis

Mime
View raw message