zephyr/tests/subsys/settings/src/settings_empty_lookups.c
François Delawarde 94451b22fc subsys/settings: Allow to register custom backends in settings subsystem
Major changes are:
- Expose settings backend API to enable custom backend support.
- Add a new CONFIG_SETTINGS_CUSTOM backend to allow registering a custom
backend.
- Change api of the handlers h_set() routines to allow for
backend-specific read callbacks.
- Provide a customizable settings_backend_init() routine for custom
backends.
- Move runtime settings support to be its own backend.

Signed-off-by: François Delawarde <fnde@oticon.com>
2019-04-26 11:24:31 +03:00

24 lines
505 B
C

/*
* Copyright (c) 2018 Nordic Semiconductor ASA
* Copyright (c) 2015 Runtime Inc
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "settings_test.h"
void config_empty_lookups(void)
{
int rc;
char name[80];
char tmp[64];
strcpy(name, "foo/bar");
rc = settings_runtime_set(name, "tmp", 4);
zassert_true(rc != 0, "settings_runtime_set callback");
strcpy(name, "foo/bar");
rc = settings_runtime_get(name, tmp, sizeof(tmp));
zassert_true(rc == -EINVAL, "settings_runtime_get callback");
}