Go to the documentation of this file.
8 #include "../../include/utils/errors.h"
10 #pragma GCC diagnostic ignored "-Wunused-parameter"
11 #pragma GCC diagnostic ignored "-Wunused-variable"
13 char *msg =
"hello world";
21 #pragma GCC diagnostic ignored "-Wunused-parameter"
22 #pragma GCC diagnostic ignored "-Wunused-variable"
24 char *msg =
"hello world";
27 strcmp(errstr,
"hello world") == 0
32 #pragma GCC diagnostic ignored "-Wunused-parameter"
33 #pragma GCC diagnostic ignored "-Wunused-variable"
37 assert(response == 0);
39 strcmp(err->
message,
"part1 | part2") == 0
45 const struct CMUnitTest tests[] = {
50 return cmocka_run_group_tests(tests, NULL, NULL);
void test_wrap_cg_error(void **state)
char * cg_error_string(char *message)
creates a new variable and moves memory of message into that variable returning it this appears to be...
cg_error * new_cg_error(char *message)
returns a cg_error struct containing message
int wrap_cg_error(cg_error *error, char *message)
appends message to the end of error->message uses realloc to maximize memory efficiency
void test_new_cg_error(void **state)
void free_cg_error(cg_error *error)
frees up resources associated with error
void test_cg_error_string(void **state)