Next: , Previous: , Up: C++ API Reference   [Contents][Index]


5.3 C++ State Reference

The following type represents the state of a test execution.

An instance of the following type is provided to set up and tear down functions when they are provided to the test. An instance of this type is provided to directed tests as well.

C++ Type: state

Handle of the execution state. The lifetime of these objects is bounded to the function call that provided it. No public constructor is available for this type.


C++ Method: char const* state::get_name () const

Preconditions:

  1. *this is in a valid state.

Effects:

  1. None

Postconditions:

  1. The returned value represents the name of the execution controlled by *this.
  2. If this->set_name was called, the returned value is equivalent to the value provided to the function call in effect.


C++ Method: void state::set_name (char const* name)
C++ Method Template: void state::set_name (SL name)

Preconditions:

  1. *this is in a valid state.
  2. name points to a valid C string.

Effects:

  1. Any value provided to this function previously stop taking effect.
  2. Store a copy of the provided name for later usage.

Postconditions:

  1. The value represented by name will be used for the execution report represented by *this.


C++ Method: bool state::keep_running ()

Preconditions:

  1. *this is in a valid state.

Effects:

  1. Perform housekeeping.

Postconditions:

  1. The value returned is true if the test should run at least one iteration more.


C++ Method: std::vector<std::size_t> state::sizes () const

Preconditions:

  1. *this is in a valid state.

Effects:

  1. None.

Postconditions:

  1. The value returned contains the sizes provided for this test execution.



Next: C++ Report Reference, Previous: C++ Test Reference, Up: C++ API Reference   [Contents][Index]