4.1 Suite Reference
The suite is represented by the following type:
- C Data Type: micro_benchmark_suite ¶
-
Opaque pointer type. This object controls the lifetime of their
derived objects, so all references obtained using an object of this
type are bound to the lifetime of that object.
- C Suite Function: micro_benchmark_suite micro_benchmark_suite_create (const char *name) ¶
-
Preconditions:
- name must point to a valid, zero-ended array of characters.
Effects:
- Creation of a new suite with name as its name.
Postconditions:
- The returned value is not
NULL
.
- C Suite Function: void micro_benchmark_suite_release (micro_benchmark_suite suite) ¶
-
Preconditions
- suite has been obtained through
micro_benchmark_suite_create
.
Effects:
- The resources associated to suite are released.
Postconditions:
- Any object pointer obtained through suite, including
suite, is invalidated.
- C Suite Function: const char * micro_benchmark_suite_get_name (micro_benchmark_suite suite) ¶
-
Preconditions:
- suite has been obtained through
micro_benchmark_suite_create
.
Effects:
- None.
Postconditions:
- The returned value is equivalent to the one provided to the call of
micro_benchmark_suite_create
that originated this suite.
- C Suite Function: micro_benchmark_test_case micro_benchmark_suite_register_test (micro_benchmark_suite suite, const char *name, micro_benchmark_test test) ¶
-
Preconditions:
- suite has been obtained through
micro_benchmark_suite_create
.
- name must point to a valid, zero-ended array of characters.
- test must point to a valid object.
Effects:
- test is added as name to the test set that suite
will run.
Postconditions:
- The returned value is not
NULL
.
- The returned value points to the registered test is enabled.
- The registered test is enabled.
- The registered test contains a disjoint copy of test.
- C Suite Function: size_t micro_benchmark_suite_get_number_of_tests (micro_benchmark_suite suite) ¶
-
Preconditions:
- suite has been obtained through
micro_benchmark_suite_create
.
Effects:
- The number of tests registered on suite, including the internal
test used to calculate the overhead of the framework.
Postconditions:
- The suite is not modified.
Note that no interface to retrieve tests by name is provided, as
several tests might be registered under the same name.
- C Suite Function: micro_benchmark_test_case micro_benchmark_suite_get_test (micro_benchmark_suite suite, size_t pos) ¶
-
Preconditions:
- suite has been obtained through
micro_benchmark_suite_create
.
- pos is less than the value returned by
micro_benchmark_suite_get_number_of_tests
.
Effects:
- None.
Postconditions:
- The suite is not modified.
- The return value is a reference to the test case at pos from
suite.
- C Suite Function: void micro_benchmark_suite_run (micro_benchmark_suite suite) ¶
-
Preconditions:
- suite has been obtained through
micro_benchmark_suite_create
.
-
micro_benchmark_suite_run (suite)
has not been called.
Effects:
- The tests registered on suite whose status is enabled are run.
- The tests registered on suite whose status is not enabled are
not run.
Postconditions:
- A report is available through
micro_benchmark_suite_get_report
.
- C Suite Function: micro_benchmark_report micro_benchmark_suite_get_report (micro_benchmark_suite suite) ¶
-
Preconditions:
- suite has been obtained through
micro_benchmark_suite_create
.
-
micro_benchmark_suite_run (suite)
has been called.
Effects:
- None.
Postconditions:
- The returned value is not
NULL
.
- The returned value is eport stored on suite.