Previous: , Up: Guile Test Reference   [Contents][Index]


6.2.2 Guile Test State Reference

Guile Foreign Object: <state>

This type represents a test execution state.

It encapsulates micro_benchmark_test_state underneath. Note that this name is not exported by the module; the name <state> is only for reference.

Objects of this type only are provided through the test case functions. These objects must not escape its calling scope, otherwise they are not considered valid.


These objects provide two predicates:

Guile Predicate: state? object

Preconditions:

  1. None.

Effects:

  1. Check if object type is <state>.

Postconditions:

  1. The value returned is #t if object is an state object, provided to a test related function.

Guile Predicate: keep-running? state

Preconditions:

  1. state is a valid object, provided through a test related function.

Effects:

  1. Perform housekeeping.
  2. Check constraints.

Postconditions:

  1. The value returned is #t if the test should perform, at least, one iteration more.

The following functions are available for objects of this type.

Guile Function: state-sizes state

Preconditions:

  1. state is a valid object, provided through a test related function.

Effects:

  1. None.

Postconditions:

  1. The returned value is a combination of the dimensional constraints provided.

Guile Function: state-name state

Preconditions:

  1. state is a valid object, provided through a test related function.

Effects:

  1. None.

Postconditions:

  1. The returned value is the name provided at the registration of the test associated to state.

Guile Function: set-state-name! state name

Preconditions:

  1. state is a valid object, provided through a test related function.

Effects:

  1. Any previous name for this test execution stops taking effect.

Postconditions:

  1. The test execution associated to state will report its name as name.


Previous: Guile Test Case Reference, Up: Guile Test Reference   [Contents][Index]