ZT_CMP_PTR(3)

ZT_CMP_PTR3

Construct a claim of a relation between two pointers

Usage

#include <zt.h>

#define ZT_CMP_PTR(left, rel, right) \
  zt_cmp_ptr( \
    ZT_CURRENT_LOCATION(), \
    zt_pack_pointer((left), (#left)), \
    zt_pack_string((#rel), (#rel)), \
    zt_pack_pointer((right), (#right)))

zt_claim

zt_cmp_ptr(zt_location location, zt_value left, zt_value rel, zt_value right);

Overview

zt_cmp_ptr() constructs a claim of a relation between two integers. It should be used through the macro ZT_CMP_PTR() which passes source code location and packs arguments.

The relation must be either ==, or !=

Implementation notes

ZT_CMP_PTR() evaluates left and right exactly once.

Return values

Both the macro and the function return a claim structure with the right attributes set. The returned claim is usually passed to zt_check() or to zt_assert().

Releases

Unchanged in 3 releases since Debian 11 (Bullseye).

  1. 11–13

History

The ZT_CMP_PTR() macro and the zt_cmp_ptr() function first appeared in libzt 0.3

Authors

Zygmunt Krynicki ⟨[email protected]⟩

From libzt-doc 0.3.1-4 in Debian 13 (Trixie). Parsed by carta from the page's mdoc source.