lv_assert.h

API reference for lv_assert.h

Report on GitHub
Summary

Macros

LV_ASSERT

 
#define LV_ASSERT(expr) \
    do { \
            if(!(expr)) { \
                LV_LOG_ERROR("Asserted at expression: %s", #expr); \
                LV_ASSERT_HANDLER \
            } \
        } while(0)

LV_ASSERT_MSG

 
#define LV_ASSERT_MSG(expr, msg) \
    do { \
            if(!(expr)) { \
                LV_LOG_ERROR("Asserted at expression: %s (%s)", #expr, msg); \
                LV_ASSERT_HANDLER \
            } \
        } while(0)

LV_ASSERT_FORMAT_MSG

 
#define LV_ASSERT_FORMAT_MSG(expr, format, ...) \
    do { \
            if(!(expr)) { \
                LV_LOG_ERROR("Asserted at expression: %s " format , #expr, __VA_ARGS__); \
                LV_ASSERT_HANDLER \
            } \
        } while(0)

LV_ASSERT_NULL

 
#define LV_ASSERT_NULL(p) \
    LV_ASSERT_MSG(p != NULL, "NULL pointer");

LV_ASSERT_MALLOC

 
#define LV_ASSERT_MALLOC(p) \
    LV_ASSERT_MSG(p != NULL, "Out of memory");

LV_ASSERT_MEM_INTEGRITY

 
#define LV_ASSERT_MEM_INTEGRITY() \
    LV_ASSERT_MSG(lv_mem_test() == LV_RESULT_OK, "Memory integrity error");

Dependencies

How is this guide?

Last updated on

On this page