Merge pull request #866 from signalwire/testframework

[Unit-Tests] Tweak test framework, fail loading unit test when out of memory.
This commit is contained in:
Andrey Volk 2020-09-22 23:27:26 +04:00 committed by GitHub
commit be42709de6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -743,6 +743,7 @@ fct_nlist__final(fct_nlist_t *list, fct_nlist_on_del_t on_del)
FCT_ASSERT( list != NULL );
fct_nlist__clear(list, on_del);
free(list->itm_list);
list->itm_list = NULL;
}
@ -2193,12 +2194,14 @@ should be directly from the program's main. */
static int
fctkern__init(fctkern_t *nk, int argc, const char *argv[])
{
int ok = 0;
if ( argc == 0 && argv == NULL )
{
return 0;
}
memset(nk, 0, sizeof(fctkern_t));
fct_clp__init(&(nk->cl_parser), NULL);
ok = fct_clp__init(&(nk->cl_parser), NULL);
if (!ok) return ok;
fct_nlist__init(&(nk->logger_list));
nk->lt_usr = NULL; /* Supplied via 'install' mechanics. */
nk->lt_sys = FCT_LOGGER_TYPES;