diff --git a/TESTS/configs/baremetal.json b/TESTS/configs/baremetal.json index d4445c1c552..20c1320018e 100644 --- a/TESTS/configs/baremetal.json +++ b/TESTS/configs/baremetal.json @@ -25,6 +25,9 @@ "system-storage", "SecureStore", "storage", + "kvstore", + "tdbstore", + "filesystemstore", "kv-global-api", "direct-access-devicekey", "kv-config", diff --git a/UNITTESTS/CMakeLists.txt b/UNITTESTS/CMakeLists.txt index 612155a15ee..6aba4ba07ff 100644 --- a/UNITTESTS/CMakeLists.txt +++ b/UNITTESTS/CMakeLists.txt @@ -122,6 +122,9 @@ set(unittest-includes-base "${PROJECT_SOURCE_DIR}/../storage/kvstore/include" "${PROJECT_SOURCE_DIR}/../storage/kvstore/kv_config" "${PROJECT_SOURCE_DIR}/../storage/kvstore/kv_config/include" + "${PROJECT_SOURCE_DIR}/../storage/kvstore/tdbstore/include" + "${PROJECT_SOURCE_DIR}/../storage/kvstore/filesystemstore/include" + "${PROJECT_SOURCE_DIR}/../storage/kvstore/kvstore_global_api/include" "${PROJECT_SOURCE_DIR}/../drivers" "${PROJECT_SOURCE_DIR}/../drivers/include" "${PROJECT_SOURCE_DIR}/../drivers/include/drivers" diff --git a/drivers/device_key/CMakeLists.txt b/drivers/device_key/CMakeLists.txt index e39979f35d5..f9397a3e2ae 100644 --- a/drivers/device_key/CMakeLists.txt +++ b/drivers/device_key/CMakeLists.txt @@ -17,4 +17,6 @@ target_sources(mbed-device_key target_link_libraries(mbed-device_key INTERFACE mbed-storage-kvstore + mbed-storage-tdbstore + mbed-storage-kv-global-api ) diff --git a/drivers/device_key/source/DeviceKey.cpp b/drivers/device_key/source/DeviceKey.cpp index bf60efd0674..decdd526025 100644 --- a/drivers/device_key/source/DeviceKey.cpp +++ b/drivers/device_key/source/DeviceKey.cpp @@ -21,8 +21,8 @@ #include "mbedtls/cmac.h" #include "mbedtls/platform.h" #include "kvstore/KVStore.h" -#include "kvstore/TDBStore.h" -#include "kvstore/KVMap.h" +#include "tdbstore/TDBStore.h" +#include "kvstore_global_api/KVMap.h" #include "kv_config/kv_config.h" #include "mbed_wait_api.h" #include diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/CMakeLists.txt index 135ff80def9..3fb2d001d6a 100644 --- a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/CMakeLists.txt +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/CMakeLists.txt @@ -24,4 +24,7 @@ target_link_libraries(mbed-psa INTERFACE mbed-mbedtls mbed-storage-kvstore + mbed-storage-tdbstore + mbed-storage-kv-global-api + mbed-device_key ) diff --git a/storage/CMakeLists.txt b/storage/CMakeLists.txt index 77182d9c249..558afc7f79a 100644 --- a/storage/CMakeLists.txt +++ b/storage/CMakeLists.txt @@ -18,6 +18,12 @@ add_library(mbed-storage-littlefs INTERFACE) add_library(mbed-storage-fat INTERFACE) add_library(mbed-storage-kvstore INTERFACE) +add_library(mbed-storage-tdbstore INTERFACE) +add_library(mbed-storage-filesystemstore INTERFACE) +add_library(mbed-storage-securestore INTERFACE) +add_library(mbed-storage-kv-config INTERFACE) +add_library(mbed-storage-direct-access-devicekey INTERFACE) +add_library(mbed-storage-kv-global-api INTERFACE) add_subdirectory(blockdevice) @@ -29,8 +35,3 @@ target_include_directories(mbed-storage INTERFACE . ) - -target_compile_definitions(mbed-storage - INTERFACE - MBED_CONF_FILESYSTEM_PRESENT=1 -) diff --git a/storage/filesystem/CMakeLists.txt b/storage/filesystem/CMakeLists.txt index da22133b2cc..c3ec4fbe64f 100644 --- a/storage/filesystem/CMakeLists.txt +++ b/storage/filesystem/CMakeLists.txt @@ -18,3 +18,8 @@ target_sources(mbed-storage-filesystem source/File.cpp source/FileSystem.cpp ) + +target_compile_definitions(mbed-storage + INTERFACE + MBED_CONF_FILESYSTEM_PRESENT=1 +) diff --git a/storage/kvstore/CMakeLists.txt b/storage/kvstore/CMakeLists.txt index ec4a58e4194..0660d39bf6a 100644 --- a/storage/kvstore/CMakeLists.txt +++ b/storage/kvstore/CMakeLists.txt @@ -1,32 +1,16 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -add_subdirectory(direct_access_devicekey) -add_subdirectory(kv_config) +add_subdirectory(tdbstore) +add_subdirectory(filesystemstore) add_subdirectory(securestore) +add_subdirectory(kv_config) +add_subdirectory(direct_access_devicekey) +add_subdirectory(kvstore_global_api) target_include_directories(mbed-storage-kvstore INTERFACE . - ./include - ./include/kvstore -) - -target_sources(mbed-storage-kvstore - INTERFACE - source/FileSystemStore.cpp - source/KVMap.cpp - source/TDBStore.cpp - source/kvstore_global_api.cpp -) - -target_link_libraries(mbed-storage-kvstore - INTERFACE - mbed-device_key - mbed-storage-blockdevice - mbed-storage-filesystem - mbed-storage-fat - mbed-storage-littlefs - mbed-storage-flashiap - mbed-storage-sd + include + include/kvstore ) diff --git a/storage/kvstore/direct_access_devicekey/CMakeLists.txt b/storage/kvstore/direct_access_devicekey/CMakeLists.txt index 5f28f1e475a..3ce9524aa33 100644 --- a/storage/kvstore/direct_access_devicekey/CMakeLists.txt +++ b/storage/kvstore/direct_access_devicekey/CMakeLists.txt @@ -1,14 +1,20 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-storage-kvstore +target_include_directories(mbed-storage-direct-access-devicekey INTERFACE . - ./include - ./include/direct_access_devicekey + include + include/direct_access_devicekey ) -target_sources(mbed-storage-kvstore +target_sources(mbed-storage-direct-access-devicekey INTERFACE source/DirectAccessDevicekey.cpp ) + +target_link_libraries(mbed-storage-direct-access-devicekey + INTERFACE + mbed-storage-kvstore + mbed-storage-kv-config +) diff --git a/storage/kvstore/tests/TESTS/direct_access_devicekey/tdb/main.cpp b/storage/kvstore/direct_access_devicekey/tests/TESTS/direct_access_devicekey/tdb/main.cpp similarity index 99% rename from storage/kvstore/tests/TESTS/direct_access_devicekey/tdb/main.cpp rename to storage/kvstore/direct_access_devicekey/tests/TESTS/direct_access_devicekey/tdb/main.cpp index 204670ff03f..eb9a3c1a0f3 100644 --- a/storage/kvstore/tests/TESTS/direct_access_devicekey/tdb/main.cpp +++ b/storage/kvstore/direct_access_devicekey/tests/TESTS/direct_access_devicekey/tdb/main.cpp @@ -24,9 +24,9 @@ #include #include "DeviceKey.h" #include "kvstore/KVStore.h" -#include "kvstore/KVMap.h" +#include "kvstore_global_api/KVMap.h" #include "kv_config/kv_config.h" -#include "kvstore/TDBStore.h" +#include "tdbstore/TDBStore.h" #include "FlashIAP.h" #include "FlashIAPBlockDevice.h" #include "direct_access_devicekey/DirectAccessDevicekey.h" diff --git a/storage/kvstore/filesystemstore/CMakeLists.txt b/storage/kvstore/filesystemstore/CMakeLists.txt new file mode 100644 index 00000000000..116a5abf2a0 --- /dev/null +++ b/storage/kvstore/filesystemstore/CMakeLists.txt @@ -0,0 +1,21 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-storage-filesystemstore + INTERFACE + . + include + include/filesystemstore +) + +target_sources(mbed-storage-filesystemstore + INTERFACE + source/FileSystemStore.cpp +) + +target_link_libraries(mbed-storage-filesystemstore + INTERFACE + mbed-storage-kvstore + mbed-storage-filesystem + mbed-storage-kv-config +) diff --git a/storage/kvstore/include/kvstore/FileSystemStore.h b/storage/kvstore/filesystemstore/include/filesystemstore/FileSystemStore.h similarity index 100% rename from storage/kvstore/include/kvstore/FileSystemStore.h rename to storage/kvstore/filesystemstore/include/filesystemstore/FileSystemStore.h diff --git a/storage/kvstore/filesystemstore/mbed_lib.json b/storage/kvstore/filesystemstore/mbed_lib.json new file mode 100644 index 00000000000..dbcba1eacf8 --- /dev/null +++ b/storage/kvstore/filesystemstore/mbed_lib.json @@ -0,0 +1,3 @@ +{ + "name": "filesystemstore" +} diff --git a/storage/kvstore/source/FileSystemStore.cpp b/storage/kvstore/filesystemstore/source/FileSystemStore.cpp similarity index 99% rename from storage/kvstore/source/FileSystemStore.cpp rename to storage/kvstore/filesystemstore/source/FileSystemStore.cpp index 7f5ad5d3200..c4a36c714e9 100644 --- a/storage/kvstore/source/FileSystemStore.cpp +++ b/storage/kvstore/filesystemstore/source/FileSystemStore.cpp @@ -16,7 +16,7 @@ * limitations under the License. */ -#include "kvstore/FileSystemStore.h" +#include "filesystemstore/FileSystemStore.h" #include "kv_config/kv_config.h" #include "filesystem/Dir.h" #include "filesystem/File.h" diff --git a/storage/kvstore/tests/TESTS/kvstore/filesystemstore_tests/main.cpp b/storage/kvstore/filesystemstore/tests/TESTS/filesystemstore/general/main.cpp similarity index 100% rename from storage/kvstore/tests/TESTS/kvstore/filesystemstore_tests/main.cpp rename to storage/kvstore/filesystemstore/tests/TESTS/filesystemstore/general/main.cpp diff --git a/storage/kvstore/tests/UNITTESTS/.mbedignore b/storage/kvstore/filesystemstore/tests/UNITTESTS/.mbedignore similarity index 100% rename from storage/kvstore/tests/UNITTESTS/.mbedignore rename to storage/kvstore/filesystemstore/tests/UNITTESTS/.mbedignore diff --git a/storage/kvstore/tests/UNITTESTS/FileSystemStore/moduletest.cpp b/storage/kvstore/filesystemstore/tests/UNITTESTS/FileSystemStore/moduletest.cpp similarity index 97% rename from storage/kvstore/tests/UNITTESTS/FileSystemStore/moduletest.cpp rename to storage/kvstore/filesystemstore/tests/UNITTESTS/FileSystemStore/moduletest.cpp index 531c60e42ac..2896a6a846d 100644 --- a/storage/kvstore/tests/UNITTESTS/FileSystemStore/moduletest.cpp +++ b/storage/kvstore/filesystemstore/tests/UNITTESTS/FileSystemStore/moduletest.cpp @@ -16,7 +16,7 @@ #include "gtest/gtest.h" #include "blockdevice/HeapBlockDevice.h" -#include "kvstore/FileSystemStore.h" +#include "filesystemstore/FileSystemStore.h" #include "littlefs/LittleFileSystem.h" #include "mbed_error.h" #include @@ -34,7 +34,7 @@ class FileSystemStoreModuleTest : public testing::Test { virtual void SetUp() { fs = new LittleFileSystem("kvstore", &heap); - if(fs->mount(&heap) != MBED_SUCCESS) { + if (fs->mount(&heap) != MBED_SUCCESS) { EXPECT_EQ(fs->reformat(&heap), MBED_SUCCESS); } store = new FileSystemStore(fs); diff --git a/storage/kvstore/tests/UNITTESTS/FileSystemStore/unittest.cmake b/storage/kvstore/filesystemstore/tests/UNITTESTS/FileSystemStore/unittest.cmake similarity index 94% rename from storage/kvstore/tests/UNITTESTS/FileSystemStore/unittest.cmake rename to storage/kvstore/filesystemstore/tests/UNITTESTS/FileSystemStore/unittest.cmake index 30230a6aaec..b12cabe8694 100644 --- a/storage/kvstore/tests/UNITTESTS/FileSystemStore/unittest.cmake +++ b/storage/kvstore/filesystemstore/tests/UNITTESTS/FileSystemStore/unittest.cmake @@ -10,7 +10,7 @@ set(unittest-includes ${unittest-includes} set(unittest-sources ../storage/blockdevice/source/HeapBlockDevice.cpp - ../storage/kvstore/source/FileSystemStore.cpp + ../storage/kvstore/filesystemstore/source/FileSystemStore.cpp ../storage/filesystem/littlefs/source/LittleFileSystem.cpp ../storage/filesystem/source/Dir.cpp ../storage/filesystem/source/File.cpp diff --git a/storage/kvstore/kv_config/CMakeLists.txt b/storage/kvstore/kv_config/CMakeLists.txt index 0cb061f16c2..131bfea36a0 100644 --- a/storage/kvstore/kv_config/CMakeLists.txt +++ b/storage/kvstore/kv_config/CMakeLists.txt @@ -1,14 +1,27 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-storage-kvstore +target_include_directories(mbed-storage-kv-config INTERFACE . - ./include - ./include/kv_config + include + include/kv_config ) -target_sources(mbed-storage-kvstore +target_sources(mbed-storage-kv-config INTERFACE source/kv_config.cpp ) + +target_link_libraries(mbed-storage-kv-config + INTERFACE + mbed-storage-kvstore + mbed-storage-blockdevice + mbed-storage-tdbstore + mbed-storage-filesystemstore + mbed-storage-securestore + mbed-storage-littlefs + mbed-storage-fat + mbed-storage-flashiap + mbed-storage-sd +) diff --git a/storage/kvstore/kv_config/source/kv_config.cpp b/storage/kvstore/kv_config/source/kv_config.cpp index 187ec74a3b7..682535a75ca 100644 --- a/storage/kvstore/kv_config/source/kv_config.cpp +++ b/storage/kvstore/kv_config/source/kv_config.cpp @@ -16,14 +16,14 @@ #include "kv_config.h" #include "kvstore/KVStore.h" -#include "kvstore/KVMap.h" +#include "kvstore_global_api/KVMap.h" #include "blockdevice/BlockDevice.h" #include "filesystem/FileSystem.h" -#include "kvstore/FileSystemStore.h" +#include "filesystemstore/FileSystemStore.h" #include "blockdevice/SlicingBlockDevice.h" #include "fat/FATFileSystem.h" #include "littlefs/LittleFileSystem.h" -#include "kvstore/TDBStore.h" +#include "tdbstore/TDBStore.h" #include "mbed_error.h" #include "drivers/FlashIAP.h" #include "blockdevice/FlashSimBlockDevice.h" diff --git a/storage/kvstore/kvstore_global_api/CMakeLists.txt b/storage/kvstore/kvstore_global_api/CMakeLists.txt new file mode 100644 index 00000000000..35196656735 --- /dev/null +++ b/storage/kvstore/kvstore_global_api/CMakeLists.txt @@ -0,0 +1,23 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-storage-kv-global-api + INTERFACE + . + include + include/kvstore_global_api +) + +target_sources(mbed-storage-kv-global-api + INTERFACE + source/KVMap.cpp + source/kvstore_global_api.cpp +) + +target_link_libraries(mbed-storage-kv-global-api + INTERFACE + mbed-storage-kvstore + mbed-storage-kv-config + mbed-storage-blockdevice + mbed-storage-filesystem +) diff --git a/storage/kvstore/include/kvstore/KVMap.h b/storage/kvstore/kvstore_global_api/include/kvstore_global_api/KVMap.h similarity index 100% rename from storage/kvstore/include/kvstore/KVMap.h rename to storage/kvstore/kvstore_global_api/include/kvstore_global_api/KVMap.h diff --git a/storage/kvstore/include/kvstore/kvstore_global_api.h b/storage/kvstore/kvstore_global_api/include/kvstore_global_api/kvstore_global_api.h similarity index 100% rename from storage/kvstore/include/kvstore/kvstore_global_api.h rename to storage/kvstore/kvstore_global_api/include/kvstore_global_api/kvstore_global_api.h diff --git a/storage/kvstore/kvstore_global_api/mbed_lib.json b/storage/kvstore/kvstore_global_api/mbed_lib.json new file mode 100644 index 00000000000..b44d08c2e6b --- /dev/null +++ b/storage/kvstore/kvstore_global_api/mbed_lib.json @@ -0,0 +1,4 @@ +{ + "name": "kv-global-api", + "requires": ["kvstore"] +} diff --git a/storage/kvstore/source/KVMap.cpp b/storage/kvstore/kvstore_global_api/source/KVMap.cpp similarity index 99% rename from storage/kvstore/source/KVMap.cpp rename to storage/kvstore/kvstore_global_api/source/KVMap.cpp index 506f0fb02d4..e0617ea5b9c 100644 --- a/storage/kvstore/source/KVMap.cpp +++ b/storage/kvstore/kvstore_global_api/source/KVMap.cpp @@ -15,7 +15,7 @@ */ #include "kvstore/KVStore.h" -#include "kvstore/KVMap.h" +#include "kvstore_global_api/KVMap.h" #include "kv_config/kv_config.h" #include #include "string.h" diff --git a/storage/kvstore/source/kvstore_global_api.cpp b/storage/kvstore/kvstore_global_api/source/kvstore_global_api.cpp similarity index 98% rename from storage/kvstore/source/kvstore_global_api.cpp rename to storage/kvstore/kvstore_global_api/source/kvstore_global_api.cpp index 9a9dcc78e34..828983fc811 100644 --- a/storage/kvstore/source/kvstore_global_api.cpp +++ b/storage/kvstore/kvstore_global_api/source/kvstore_global_api.cpp @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "kvstore_global_api.h" +#include "kvstore_global_api/kvstore_global_api.h" #include "kv_config/kv_config.h" -#include "kvstore/KVMap.h" +#include "kvstore_global_api/KVMap.h" #include "kvstore/KVStore.h" #include "mbed_error.h" diff --git a/storage/kvstore/mbed_lib.json b/storage/kvstore/mbed_lib.json index 7facc6b0dc8..4c2e0653c5e 100644 --- a/storage/kvstore/mbed_lib.json +++ b/storage/kvstore/mbed_lib.json @@ -1,3 +1,3 @@ { - "name": "kv-global-api" + "name": "kvstore" } diff --git a/storage/kvstore/securestore/CMakeLists.txt b/storage/kvstore/securestore/CMakeLists.txt index 2e33c509c3a..5fc2e7d3414 100644 --- a/storage/kvstore/securestore/CMakeLists.txt +++ b/storage/kvstore/securestore/CMakeLists.txt @@ -1,14 +1,20 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -target_include_directories(mbed-storage-kvstore +target_include_directories(mbed-storage-securestore INTERFACE . - ./include - ./include/securestore + include + include/securestore ) -target_sources(mbed-storage-kvstore +target_sources(mbed-storage-securestore INTERFACE source/SecureStore.cpp ) + +target_link_libraries(mbed-storage-securestore + INTERFACE + mbed-storage-kvstore + mbed-device_key +) diff --git a/storage/kvstore/tests/TESTS/securestore/whitebox/main.cpp b/storage/kvstore/securestore/tests/TESTS/securestore/whitebox/main.cpp similarity index 99% rename from storage/kvstore/tests/TESTS/securestore/whitebox/main.cpp rename to storage/kvstore/securestore/tests/TESTS/securestore/whitebox/main.cpp index 5cb1b2183f8..8c10e068dc9 100644 --- a/storage/kvstore/tests/TESTS/securestore/whitebox/main.cpp +++ b/storage/kvstore/securestore/tests/TESTS/securestore/whitebox/main.cpp @@ -17,7 +17,7 @@ */ #include "securestore/SecureStore.h" -#include "kvstore/TDBStore.h" +#include "tdbstore/TDBStore.h" #ifdef MBED_CONF_RTOS_PRESENT #include "Thread.h" #endif diff --git a/storage/kvstore/tdbstore/CMakeLists.txt b/storage/kvstore/tdbstore/CMakeLists.txt new file mode 100644 index 00000000000..38a992a488a --- /dev/null +++ b/storage/kvstore/tdbstore/CMakeLists.txt @@ -0,0 +1,20 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-storage-tdbstore + INTERFACE + . + include + include/tdbstore +) + +target_sources(mbed-storage-tdbstore + INTERFACE + source/TDBStore.cpp +) + +target_link_libraries(mbed-storage-tdbstore + INTERFACE + mbed-storage-kvstore + mbed-storage-blockdevice +) diff --git a/storage/kvstore/include/kvstore/TDBStore.h b/storage/kvstore/tdbstore/include/tdbstore/TDBStore.h similarity index 100% rename from storage/kvstore/include/kvstore/TDBStore.h rename to storage/kvstore/tdbstore/include/tdbstore/TDBStore.h diff --git a/storage/kvstore/tdbstore/mbed_lib.json b/storage/kvstore/tdbstore/mbed_lib.json new file mode 100644 index 00000000000..9ae5f7a8895 --- /dev/null +++ b/storage/kvstore/tdbstore/mbed_lib.json @@ -0,0 +1,3 @@ +{ + "name": "tdbstore" +} diff --git a/storage/kvstore/source/TDBStore.cpp b/storage/kvstore/tdbstore/source/TDBStore.cpp similarity index 99% rename from storage/kvstore/source/TDBStore.cpp rename to storage/kvstore/tdbstore/source/TDBStore.cpp index 6c74ac0a1e2..5d1539dcf5e 100644 --- a/storage/kvstore/source/TDBStore.cpp +++ b/storage/kvstore/tdbstore/source/TDBStore.cpp @@ -16,7 +16,7 @@ // ----------------------------------------------------------- Includes ----------------------------------------------------------- -#include "kvstore/TDBStore.h" +#include "tdbstore/TDBStore.h" #include #include diff --git a/storage/kvstore/tests/TESTS/kvstore/tdbstore_whitebox/main.cpp b/storage/kvstore/tdbstore/tests/TESTS/tdbstore/whitebox/main.cpp similarity index 100% rename from storage/kvstore/tests/TESTS/kvstore/tdbstore_whitebox/main.cpp rename to storage/kvstore/tdbstore/tests/TESTS/tdbstore/whitebox/main.cpp diff --git a/storage/kvstore/tdbstore/tests/UNITTESTS/.mbedignore b/storage/kvstore/tdbstore/tests/UNITTESTS/.mbedignore new file mode 100644 index 00000000000..72e8ffc0db8 --- /dev/null +++ b/storage/kvstore/tdbstore/tests/UNITTESTS/.mbedignore @@ -0,0 +1 @@ +* diff --git a/storage/kvstore/tests/UNITTESTS/TDBStore/moduletest.cpp b/storage/kvstore/tdbstore/tests/UNITTESTS/TDBStore/moduletest.cpp similarity index 95% rename from storage/kvstore/tests/UNITTESTS/TDBStore/moduletest.cpp rename to storage/kvstore/tdbstore/tests/UNITTESTS/TDBStore/moduletest.cpp index c51680e5f9d..1fab776f91d 100644 --- a/storage/kvstore/tests/UNITTESTS/TDBStore/moduletest.cpp +++ b/storage/kvstore/tdbstore/tests/UNITTESTS/TDBStore/moduletest.cpp @@ -17,7 +17,7 @@ #include "gtest/gtest.h" #include "blockdevice/HeapBlockDevice.h" #include "blockdevice/FlashSimBlockDevice.h" -#include "kvstore/TDBStore.h" +#include "tdbstore/TDBStore.h" #include #define BLOCK_SIZE (256) @@ -104,7 +104,7 @@ TEST_F(TDBStoreModuleTest, corrupted_set_deinit_init_get) for (int i = 0; i < 100; ++i) { EXPECT_EQ(tdb.deinit(), MBED_SUCCESS); // Corrupt the first part of the storage - for (int j = 0; j < heap.size()/BLOCK_SIZE/2; j++) { + for (int j = 0; j < heap.size() / BLOCK_SIZE / 2; j++) { for (int k = 0; k < BLOCK_SIZE; k++) { block[k] = rand(); } @@ -113,12 +113,12 @@ TEST_F(TDBStoreModuleTest, corrupted_set_deinit_init_get) EXPECT_EQ(tdb.init(), MBED_SUCCESS); for (int j = 0; j < 100; ++j) { // Use random data, so the data has to be updated - EXPECT_EQ(tdb.set("key", block+j, 50, 0), MBED_SUCCESS); + EXPECT_EQ(tdb.set("key", block + j, 50, 0), MBED_SUCCESS); EXPECT_EQ(tdb.deinit(), MBED_SUCCESS); EXPECT_EQ(tdb.init(), MBED_SUCCESS); EXPECT_EQ(tdb.get("key", buf, 100, &size), MBED_SUCCESS); EXPECT_EQ(size, 50); - EXPECT_EQ(0, memcmp(buf, block+j, size)); + EXPECT_EQ(0, memcmp(buf, block + j, size)); } EXPECT_EQ(tdb.remove("key"), MBED_SUCCESS); } diff --git a/storage/kvstore/tests/UNITTESTS/TDBStore/unittest.cmake b/storage/kvstore/tdbstore/tests/UNITTESTS/TDBStore/unittest.cmake similarity index 91% rename from storage/kvstore/tests/UNITTESTS/TDBStore/unittest.cmake rename to storage/kvstore/tdbstore/tests/UNITTESTS/TDBStore/unittest.cmake index dccc8407771..e11382cd33c 100644 --- a/storage/kvstore/tests/UNITTESTS/TDBStore/unittest.cmake +++ b/storage/kvstore/tdbstore/tests/UNITTESTS/TDBStore/unittest.cmake @@ -13,7 +13,7 @@ set(unittest-sources ../storage/blockdevice/source/FlashSimBlockDevice.cpp ../storage/blockdevice/source/HeapBlockDevice.cpp ../storage/blockdevice/source/BufferedBlockDevice.cpp - ../storage/kvstore/source/TDBStore.cpp + ../storage/kvstore/tdbstore/source/TDBStore.cpp ../platform/mbed-trace/source/mbed_trace.c stubs/mbed_atomic_stub.c stubs/mbed_assert_stub.cpp diff --git a/storage/kvstore/tests/TESTS/kvstore/general_tests_phase_1/main.cpp b/storage/kvstore/tests/TESTS/kvstore/general_tests_phase_1/main.cpp index ef7ad4d346d..d225294f92b 100644 --- a/storage/kvstore/tests/TESTS/kvstore/general_tests_phase_1/main.cpp +++ b/storage/kvstore/tests/TESTS/kvstore/general_tests_phase_1/main.cpp @@ -15,7 +15,7 @@ * limitations under the License. */ #include "securestore/SecureStore.h" -#include "kvstore/TDBStore.h" +#include "tdbstore/TDBStore.h" #ifdef MBED_CONF_RTOS_PRESENT #include "Thread.h" #endif diff --git a/storage/kvstore/tests/TESTS/kvstore/general_tests_phase_2/main.cpp b/storage/kvstore/tests/TESTS/kvstore/general_tests_phase_2/main.cpp index f19560858e5..275c024244b 100644 --- a/storage/kvstore/tests/TESTS/kvstore/general_tests_phase_2/main.cpp +++ b/storage/kvstore/tests/TESTS/kvstore/general_tests_phase_2/main.cpp @@ -15,7 +15,7 @@ * limitations under the License. */ #include "securestore/SecureStore.h" -#include "kvstore/TDBStore.h" +#include "tdbstore/TDBStore.h" #include "mbed_error.h" #include "FlashSimBlockDevice.h" #include "SlicingBlockDevice.h"