Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
ztest_assert.h File Reference

Zephyr testing framework assertion macros. More...

#include <ztest.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>

Go to the source code of this file.

Macros

#define zassert(cond, default_msg, msg, ...)
 Fail the test, if cond is false. More...
 
#define zassert_unreachable(msg, ...)
 Assert that this function call won't be reached. More...
 
#define zassert_true(cond, msg, ...)
 Assert that cond is true. More...
 
#define zassert_false(cond, msg, ...)
 Assert that cond is false. More...
 
#define zassert_ok(cond, msg, ...)
 Assert that cond is 0 (success) More...
 
#define zassert_is_null(ptr, msg, ...)
 Assert that ptr is NULL. More...
 
#define zassert_not_null(ptr, msg, ...)
 Assert that ptr is not NULL. More...
 
#define zassert_equal(a, b, msg, ...)
 Assert that a equals b. More...
 
#define zassert_not_equal(a, b, msg, ...)
 Assert that a does not equal b. More...
 
#define zassert_equal_ptr(a, b, msg, ...)
 Assert that a equals b. More...
 
#define zassert_within(a, b, d, msg, ...)
 Assert that a is within b with delta d. More...
 
#define zassert_mem_equal(...)    zassert_mem_equal__(__VA_ARGS__)
 Assert that 2 memory buffers have the same contents. More...
 
#define zassert_mem_equal__(buf, exp, size, msg, ...)
 Internal assert that 2 memory buffers have the same contents. More...
 

Functions

const char * ztest_relative_filename (const char *file)
 
void ztest_test_fail (void)
 

Detailed Description

Zephyr testing framework assertion macros.

Function Documentation

◆ ztest_relative_filename()

const char * ztest_relative_filename ( const char *  file)

◆ ztest_test_fail()

void ztest_test_fail ( void  )