| the Compartmented Robust Posix C++ Unit Test system |
|
|---|
Get the value of a named parameter defined with the
-p
name=value / --param=name=value command line
parameter.
Used in: A test function body, the constructor or destructor of a
fixture, or a function called from
them.
See TEST(name, ...).
crpcut::get_parameter() exists
in no less than five flavours.
Flavour
get_parameter(const char *name)Returns the raw C-string value of the parameter, or
0 if no parameter was defined with the
provided name.
get_parameter(const char *name, T& t)Convert the raw value to type T by means of
operator>>(std::istream&, T&). If no parameter was defined with the provided name,
or if the input streaming failed, the test will fail.
get_parameter(const char *name)Convert the raw value to type T by means of
operator>>(std::istream&, T&). If no parameter was defined with the provided name,
or if the input streaming failed, the test will fail.
get_parameter<std::istream>(const char *name)Get an istream from the parameter to extract values from, possibly with the use of stream manipulators. The crpcut::istream_wrapper checks the results of the extractions and fails the test if the extraction fails.
get_parameter<crpcut::relaxed<std::istream> >(const char *name)Get an istream from the parameter to extract values from, possibly with the use of stream manipulators. The crpcut::iastream is a pure std::istream implementation, which will set the stream status bits for you to check.