zephyr/tests/subsys/settings/src/settings_test_insert.c
Meng xianglin 96484695e7 tests: settings: move to new ztest API
test cases in tests/subsys/settings/fcb, tests/subsys/settings/littlefs,
tests/subsys/setttings/nvs all depend on tests/subsys/settings/src and
tests/subsys/settings/fs, so update them in one commit.

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2022-08-26 11:56:51 +02:00

49 lines
857 B
C

/*
* Copyright (c) 2018 Nordic Semiconductor ASA
* Copyright (c) 2015 Runtime Inc
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "settings_test.h"
void test_config_insert_x(int idx)
{
int rc;
rc = settings_register(&c_test_handlers[idx]);
zassert_true(rc == 0, "settings_register fail");
}
int settings_unregister(struct settings_handler *handler)
{
extern sys_slist_t settings_handlers;
return sys_slist_find_and_remove(&settings_handlers, &handler->node);
}
void test_config_insert2(void)
{
test_config_insert_x(1);
}
void test_config_insert3(void)
{
test_config_insert_x(2);
}
void *settings_config_setup(void)
{
int rc;
rc = settings_register(&c_test_handlers[0]);
zassume_true(rc == 0, "settings_register fail");
return NULL;
}
void settings_config_teardown(void *fixture)
{
settings_unregister(&c_test_handlers[0]);
}