Fix memory leak in UefiVariableStoreTests
Clear mock storages from the test group's teardown function.
Signed-off-by: Imre Kis <imre.kis@arm.com>
Change-Id: I84413c4ac5510a90b6611c2ccb4a15de54ecb47d
diff --git a/components/service/smm_variable/backend/test/variable_store_tests.cpp b/components/service/smm_variable/backend/test/variable_store_tests.cpp
index 33d8677..fc9bcde 100644
--- a/components/service/smm_variable/backend/test/variable_store_tests.cpp
+++ b/components/service/smm_variable/backend/test/variable_store_tests.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -45,6 +45,8 @@
void teardown()
{
uefi_variable_store_deinit(&m_uefi_variable_store);
+ mock_store_reset(&m_persistent_store);
+ mock_store_reset(&m_volatile_store);
}
void setup_common_guid()