Currently there is inconsistency in repository file names, APIs, Kconfig options and documentation around file / file-system backend for settings storage, as both "file" and "FS (file system)" are used. As an example, there is `CONFIG_SETTINGS_FS` Kconfig option, but the file that implements this settings backend is called `settings_file.c`. Another example are names of static functions that implement settings storage API: `settings_file_load()`, `settings_file_save()` and `settings_fs_storage_get()`. This backend is actually storing all settings in a single file, so it makes sense to use "File" as the name of backend, instead of a more general "FS" (which would make sense if several files would be used to store settings). Fix inconsistency in used wording in the tree and unify it to "settings file backend". This naming is more precise to how the implementation looks. It will also make it easier to grep through the codebase and analyze existing code. Deprecate settings_mount_fs_backend() function and all Kconfig options starting with `CONFIG_SETTINGS_FS`. Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
27 lines
666 B
C
27 lines
666 B
C
/* SPDX-License-Identifier: Apache-2.0 */
|
|
/* Copyright (c) 2022 Nordic semiconductor ASA */
|
|
|
|
#include <zephyr/kernel.h>
|
|
#include <zephyr/ztest.h>
|
|
#include <errno.h>
|
|
#include <zephyr/settings/settings.h>
|
|
#include <zephyr/fs/fs.h>
|
|
|
|
ZTEST(settings_functional, test_setting_storage_get)
|
|
{
|
|
int rc;
|
|
void *storage;
|
|
|
|
struct fs_dirent entry;
|
|
|
|
rc = settings_storage_get(&storage);
|
|
zassert_equal(0, rc, "Can't fetch storage reference (err=%d)", rc);
|
|
|
|
zassert_not_null(storage, "Null reference.");
|
|
|
|
rc = fs_stat((const char *)storage, &entry);
|
|
|
|
zassert_true(rc >= 0, "Can't find the file (err=%d)", rc);
|
|
}
|
|
ZTEST_SUITE(settings_functional, NULL, NULL, NULL, NULL, NULL);
|