[go: up one dir, main page]

File: assert.rst

package info (click to toggle)
criterion 2.4.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 3,864 kB
  • sloc: ansic: 17,945; cpp: 774; python: 74; makefile: 25; sh: 19
file content (38 lines) | stat: -rw-r--r-- 1,107 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
.. _assertions-ref:

Assertion reference
===================

This is an exhaustive list of all assertion macros that Criterion provides.

.. note::
   This documents the new (but experimental) assertion API. To see the
   documentation of the old API, see: :ref:`old-assertions-ref`.

The new assertions API is centered around the use of criteria pseudo-functions
to check various properties of the values being tested. Of note, there no longer
are ``cr_assert_<xyz>`` macros, and instead all functionality has been merged into
the ``cr_assert`` and ``cr_expect`` macros. For instance, instead of using
``cr_assert_eq(1, 2)`` one must use instead ``cr_assert(eq(int, 1, 2))``, which
involves the ``eq`` criterion and the ``int`` type tag.

To use the new assertion API, one must include the ``<criterion/new/assert.h>`` header.

All ``assert`` macros may take an optional ``printf`` format string and
parameters.

Assertion API
-------------

.. doxygengroup:: AssertAPI

Assertion Criteria
------------------

.. doxygengroup:: Criteria
.. doxygengroup:: TaggedCriteria

Tags
----

.. doxygengroup:: Tags