- Add unit tests for handlers - Update sources.mk to remove test_parse.c from test sources - Fix in handle_size to set packet_size instead of count
17 lines
503 B
C
17 lines
503 B
C
#include "cli.h"
|
|
#include <criterion/criterion.h>
|
|
#include <stddef.h>
|
|
|
|
/* Test 1: g_options is null terminated */
|
|
Test(_test_handler_map, always_pass)
|
|
{
|
|
size_t i = 0;
|
|
for (i = 0; NULL != g_options[i].description; ++i);
|
|
|
|
cr_assert(g_options[i].description == NULL);
|
|
cr_assert(g_options[i].arg_type == 0);
|
|
cr_assert(g_options[i].handler == NULL);
|
|
cr_assert(g_options[i].has_arg == 0);
|
|
cr_assert(g_options[i].long_opt == NULL);
|
|
cr_assert(g_options[i].short_opt == 0);
|
|
}
|