DOKK / manpages / debian 12 / libzt-doc / ZT_TRUE.3.en
ZT_TRUE(3) Library Functions Manual (prm) ZT_TRUE(3)

ZT_TRUE, zt_trueconstruct a claim that a value is true

#include <zt.h>

#define ZT_TRUE(value) \
  zt_true( \
    ZT_CURRENT_LOCATION(), \
    zt_pack_boolean((value), #value)) \

zt_claim
zt_true(zt_location location, zt_value value);

() constructs a claim that a given value is true. It should be used through the macro (), which passes source code location and packs argument.

() can be used to check custom properties by calling arbitrary verification logic. The disadvantage of this approach is that on failure, the error message cannot precisely explain the problem.

ZT_TRUE() evaluates only once.

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

zt_assert(3), zt_check(3), zt_claim(3), ZT_CMP_BOOL(3), ZT_CMP_RUNE(3), ZT_CMP_CSTR(3), ZT_CMP_INT(3), ZT_CMP_PTR(3), ZT_CMP_UINT(3), ZT_FALSE(3), ZT_NOT_NULL(3), ZT_NULL(3) zt_value(3),

The ZT_TRUE() macro and the zt_true() function first appeared in libzt 0.1

Zygmunt Krynicki <me@zygoon.pl>

January 12, 2020 libzt 0.3.1