libamxb  4.8.2
Bus Agnostic C API
test_amxb_error.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <dlfcn.h>
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include <amxc/amxc_variant.h>
#include <amxc/amxc_htable.h>
#include <amxb/amxb_error.h>
#include "test_amxb_error.h"
#include <amxc/amxc_macros.h>

Go to the source code of this file.

Functions

void test_amxb_be_error (UNUSED void **state)
 

Function Documentation

◆ test_amxb_be_error()

void test_amxb_be_error ( UNUSED void **  state)

Definition at line 70 of file test_amxb_error.c.

70  {
71  assert_ptr_equal(amxb_get_error(-1), NULL);
72  assert_ptr_equal(amxb_get_error(AMXB_ERROR_MAX + 1), NULL);
73  for(int i = 0; i < AMXB_ERROR_MAX; i++) {
74  const char* text = amxb_get_error(i);
75  printf("Error %d = ", i);
76  assert_ptr_not_equal(text, NULL);
77  printf("%s\n", text);
78  }
79 }
#define AMXB_ERROR_MAX
Definition: amxb_error.h:130
const char * amxb_get_error(int error)
Definition: amxb_error.c:70