ZT_CMP_INT(3)

#define ZT_CMP_INT(left, rel, right) zt_cmp_int( ZT_CURRENT_LOCATION(), zt_pack_integer((left), (#left)), zt

Section 3 libzt-doc bookworm source

Description

UNTITLED() LOCAL UNTITLED()

NAME

ZT_CMP_INT, zt_cmp_int — construct a claim of a relation between two integers

SYNOPSIS

#include <zt.h>

#define ZT_CMP_INT(left, rel, right) \
zt_cmp_int( \
ZT_CURRENT_LOCATION(), \
zt_pack_integer((left), (#left)), \
zt_pack_string((#rel), (#rel)), \
zt_pack_integer((right), (#right)))

zt_claim

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

DESCRIPTION

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

The relation must be one of ==, !=, <, <=, > or >=.

IMPLEMENTATION NOTES

ZT_CMP_INT() 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().

SEE ALSO

ZT_CMP_BOOL(3), ZT_CMP_RUNE(3), ZT_CMP_CSTR(3), ZT_CMP_PTR(3), ZT_CMP_UINT(3), ZT_FALSE(3), ZT_NOT_NULL(3), ZT_NULL(3), ZT_TRUE(3), zt_check(3),

HISTORY

The ZT_CMP_INT() macro and the zt_cmp_int() function first appeared in libzt 0.1

Since libzt 0.3 zt_cmp_int() internally promotes left and right arguments from ZT_INTEGER to ZT_INTMAX.

AUTHORS

Zygmunt Krynicki <me@zygoon.pl> libzt 0.3.1 January 12, 2020 ZT_CMP_INT(3)