---
name: "ZT_TRUE"
section: "3"
platform: "linux"
package: "libzt-doc"
version: "0.3.1-4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/ZT_TRUE"
---

# ZT\_TRUE(3)

construct a claim that a value is true

## NAME

**ZT\_TRUE**, **zt\_true** – construct a claim that a value is true

## SYNOPSIS

**#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*);

## DESCRIPTION

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

**zt\_true**() 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.

## IMPLEMENTATION NOTES

**ZT\_TRUE**() evaluates *value* only once.

## RETURN VALUES

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

## SEE ALSO

zt\_assert(3), [zt\_check(3)](/zt_check/3.md), [zt\_claim(3)](/zt_claim/3.md), [ZT\_CMP\_BOOL(3)](/ZT_CMP_BOOL/3.md), [ZT\_CMP\_RUNE(3)](/ZT_CMP_RUNE/3.md), ZT\_CMP\_CSTR(3), [ZT\_CMP\_INT(3)](/ZT_CMP_INT/3.md), [ZT\_CMP\_PTR(3)](/ZT_CMP_PTR/3.md), [ZT\_CMP\_UINT(3)](/ZT_CMP_UINT/3.md), [ZT\_FALSE(3)](/ZT_FALSE/3.md), [ZT\_NOT\_NULL(3)](/ZT_NOT_NULL/3.md), [ZT\_NULL(3)](/ZT_NULL/3.md) [zt\_value(3)](/zt_value/3.md),

## HISTORY

The **ZT\_TRUE**() macro and the **zt\_true**() function first appeared in libzt 0.1

## AUTHORS

Zygmunt Krynicki ⟨*me@zygoon.pl*⟩
