1 /* 2 * Copyright (c) 2018 Nordic Semiconductor ASA 3 * Copyright (c) 2015 Runtime Inc 4 * 5 * SPDX-License-Identifier: Apache-2.0 6 */ 7 8 #include "settings_test.h" 9 test_config_insert_x(int idx)10void test_config_insert_x(int idx) 11 { 12 int rc; 13 14 rc = settings_register(&c_test_handlers[idx]); 15 zassert_true(rc == 0, "settings_register fail"); 16 } 17 settings_unregister(struct settings_handler * handler)18int settings_unregister(struct settings_handler *handler) 19 { 20 extern sys_slist_t settings_handlers; 21 22 return sys_slist_find_and_remove(&settings_handlers, &handler->node); 23 } 24 test_config_insert2(void)25void test_config_insert2(void) 26 { 27 test_config_insert_x(1); 28 } 29 test_config_insert3(void)30void test_config_insert3(void) 31 { 32 test_config_insert_x(2); 33 } 34 settings_config_setup(void)35void *settings_config_setup(void) 36 { 37 int rc; 38 39 rc = settings_register(&c_test_handlers[0]); 40 zassume_true(rc == 0, "settings_register fail"); 41 return NULL; 42 } 43 settings_config_teardown(void * fixture)44void settings_config_teardown(void *fixture) 45 { 46 47 settings_unregister(&c_test_handlers[0]); 48 } 49