mirror of
				https://github.com/espressif/esp-idf.git
				synced 2025-11-04 14:14:11 +00:00 
			
		
		
		
	Merge branch 'contrib/github_pr_15656' into 'master'
fix(nvs_flash): removed usage of 'using namepsace std' in a header file (GitHub PR) Closes IDFGH-14947 See merge request espressif/esp-idf!38086
This commit is contained in:
		@@ -20,6 +20,8 @@
 | 
				
			|||||||
#include "test_fixtures.hpp"
 | 
					#include "test_fixtures.hpp"
 | 
				
			||||||
#include "spi_flash_mmap.h"
 | 
					#include "spi_flash_mmap.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using namespace std;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define TEST_ESP_ERR(rc, res) CHECK((rc) == (res))
 | 
					#define TEST_ESP_ERR(rc, res) CHECK((rc) == (res))
 | 
				
			||||||
#define TEST_ESP_OK(rc) CHECK((rc) == ESP_OK)
 | 
					#define TEST_ESP_OK(rc) CHECK((rc) == ESP_OK)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,6 +11,8 @@
 | 
				
			|||||||
#include "test_fixtures.hpp"
 | 
					#include "test_fixtures.hpp"
 | 
				
			||||||
#include <iostream>
 | 
					#include <iostream>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using namespace std;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST_CASE("NVSHandleSimple CXX api open invalid arguments", "[nvs cxx]")
 | 
					TEST_CASE("NVSHandleSimple CXX api open invalid arguments", "[nvs cxx]")
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    const uint32_t NVS_FLASH_SECTOR = 6;
 | 
					    const uint32_t NVS_FLASH_SECTOR = 6;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,6 +12,8 @@
 | 
				
			|||||||
#include <iostream>
 | 
					#include <iostream>
 | 
				
			||||||
#include <string>
 | 
					#include <string>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using namespace std;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define TEMPORARILY_DISABLED(x)
 | 
					#define TEMPORARILY_DISABLED(x)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST_CASE("NVSHandleSimple closes its reference in PartitionManager", "[partition_mgr]")
 | 
					TEST_CASE("NVSHandleSimple closes its reference in PartitionManager", "[partition_mgr]")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,6 +11,8 @@
 | 
				
			|||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include "esp_partition.h"
 | 
					#include "esp_partition.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using namespace std;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST_CASE("nvs_flash_init_partition_ptr fails due to nullptr arg", "[nvs_custom_part]")
 | 
					TEST_CASE("nvs_flash_init_partition_ptr fails due to nullptr arg", "[nvs_custom_part]")
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    uint8_t *p_part_desc_addr_start;
 | 
					    uint8_t *p_part_desc_addr_start;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,6 +10,8 @@
 | 
				
			|||||||
#include "test_fixtures.hpp"
 | 
					#include "test_fixtures.hpp"
 | 
				
			||||||
#include <iostream>
 | 
					#include <iostream>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using namespace std;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST_CASE("Storage iterator recognizes blob with VerOffset::VER_1_OFFSET", "[nvs_storage]")
 | 
					TEST_CASE("Storage iterator recognizes blob with VerOffset::VER_1_OFFSET", "[nvs_storage]")
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    const uint32_t NVS_FLASH_SECTOR = 6;
 | 
					    const uint32_t NVS_FLASH_SECTOR = 6;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,6 +11,8 @@
 | 
				
			|||||||
#include "nvs_test_api.h"
 | 
					#include "nvs_test_api.h"
 | 
				
			||||||
#include "test_fixtures.hpp"
 | 
					#include "test_fixtures.hpp"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using namespace std;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST_CASE("Partition manager initializes storage", "[partition_mgr]")
 | 
					TEST_CASE("Partition manager initializes storage", "[partition_mgr]")
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    const uint32_t NVS_FLASH_SECTOR = 6;
 | 
					    const uint32_t NVS_FLASH_SECTOR = 6;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,22 +1,16 @@
 | 
				
			|||||||
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
 | 
					/*
 | 
				
			||||||
//
 | 
					 * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
 | 
				
			||||||
// Licensed under the Apache License, Version 2.0 (the "License");
 | 
					 *
 | 
				
			||||||
// you may not use this file except in compliance with the License.
 | 
					 * SPDX-License-Identifier: Apache-2.0
 | 
				
			||||||
// You may obtain a copy of the License at
 | 
					 */
 | 
				
			||||||
 | 
					 | 
				
			||||||
//     http://www.apache.org/licenses/LICENSE-2.0
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
// Unless required by applicable law or agreed to in writing, software
 | 
					 | 
				
			||||||
// distributed under the License is distributed on an "AS IS" BASIS,
 | 
					 | 
				
			||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
					 | 
				
			||||||
// See the License for the specific language governing permissions and
 | 
					 | 
				
			||||||
// limitations under the License.
 | 
					 | 
				
			||||||
#include "nvs_partition_manager.hpp"
 | 
					#include "nvs_partition_manager.hpp"
 | 
				
			||||||
#include "nvs_handle.hpp"
 | 
					#include "nvs_handle.hpp"
 | 
				
			||||||
#include "nvs_handle_simple.hpp"
 | 
					#include "nvs_handle_simple.hpp"
 | 
				
			||||||
#include "nvs_handle_locked.hpp"
 | 
					#include "nvs_handle_locked.hpp"
 | 
				
			||||||
#include "nvs_platform.hpp"
 | 
					#include "nvs_platform.hpp"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using namespace std;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace nvs {
 | 
					namespace nvs {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
std::unique_ptr<NVSHandle> open_nvs_handle_from_partition(const char *partition_name,
 | 
					std::unique_ptr<NVSHandle> open_nvs_handle_from_partition(const char *partition_name,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,8 @@
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
#include "nvs_pagemanager.hpp"
 | 
					#include "nvs_pagemanager.hpp"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using namespace std;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace nvs
 | 
					namespace nvs
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
esp_err_t PageManager::load(Partition *partition, uint32_t baseSector, uint32_t sectorCount)
 | 
					esp_err_t PageManager::load(Partition *partition, uint32_t baseSector, uint32_t sectorCount)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,6 +12,8 @@
 | 
				
			|||||||
#include "nvs_encrypted_partition.hpp"
 | 
					#include "nvs_encrypted_partition.hpp"
 | 
				
			||||||
#endif // ! LINUX_TARGET
 | 
					#endif // ! LINUX_TARGET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using namespace std;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace nvs {
 | 
					namespace nvs {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
NVSPartitionManager* NVSPartitionManager::instance = nullptr;
 | 
					NVSPartitionManager* NVSPartitionManager::instance = nullptr;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,8 +15,6 @@
 | 
				
			|||||||
#include "compressed_enum_table.hpp"
 | 
					#include "compressed_enum_table.hpp"
 | 
				
			||||||
#include "string.h"
 | 
					#include "string.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using namespace std;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace nvs
 | 
					namespace nvs
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -97,7 +95,7 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    void getKey(char* dst, size_t dstSize)
 | 
					    void getKey(char* dst, size_t dstSize)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        strncpy(dst, key, min(dstSize, sizeof(key)));
 | 
					        strncpy(dst, key, std::min(dstSize, sizeof(key)));
 | 
				
			||||||
        dst[dstSize-1] = 0;
 | 
					        dst[dstSize-1] = 0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -486,7 +486,6 @@ components/mbedtls/port/include/sha256_alt.h
 | 
				
			|||||||
components/mbedtls/port/include/sha512_alt.h
 | 
					components/mbedtls/port/include/sha512_alt.h
 | 
				
			||||||
components/mbedtls/port/sha/parallel_engine/sha.c
 | 
					components/mbedtls/port/sha/parallel_engine/sha.c
 | 
				
			||||||
components/nvs_flash/include/nvs_handle.hpp
 | 
					components/nvs_flash/include/nvs_handle.hpp
 | 
				
			||||||
components/nvs_flash/src/nvs_cxx_api.cpp
 | 
					 | 
				
			||||||
components/nvs_flash/src/nvs_encrypted_partition.hpp
 | 
					components/nvs_flash/src/nvs_encrypted_partition.hpp
 | 
				
			||||||
components/nvs_flash/src/nvs_item_hash_list.cpp
 | 
					components/nvs_flash/src/nvs_item_hash_list.cpp
 | 
				
			||||||
components/nvs_flash/src/nvs_pagemanager.hpp
 | 
					components/nvs_flash/src/nvs_pagemanager.hpp
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user