This repository has been archived by the owner on Aug 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch includes unit tests to cover the changes for the incorrect error handling fix when a set_sate fails and no response was being generated. Signed-off-by: Katherine Vincent <katherine.vincent@arm.com> Change-Id: I4bf5ff420b01eb67b2b43c7c9252d43ad5bcdf9a
- Loading branch information
1 parent
3b3c058
commit acd48f6
Showing
9 changed files
with
3,310 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# | ||
# Arm SCP/MCP Software | ||
# Copyright (c) 2024, Arm Limited and Contributors. All rights reserved. | ||
# | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# | ||
|
||
set(TEST_SRC mod_scmi_power_domain) | ||
set(TEST_FILE mod_scmi_power_domain) | ||
|
||
set(UNIT_TEST_TARGET mod_${TEST_MODULE}_unit_test) | ||
|
||
set(MODULE_SRC ${MODULE_ROOT}/${TEST_MODULE}/src) | ||
set(MODULE_INC ${MODULE_ROOT}/${TEST_MODULE}/include) | ||
list(APPEND OTHER_MODULE_INC ${MODULE_ROOT}/scmi/include) | ||
list(APPEND OTHER_MODULE_INC ${MODULE_ROOT}/power_domain/include) | ||
set(MODULE_UT_SRC ${CMAKE_CURRENT_LIST_DIR}) | ||
set(MODULE_UT_INC ${CMAKE_CURRENT_LIST_DIR}) | ||
set(MODULE_UT_MOCK_SRC ${CMAKE_CURRENT_LIST_DIR}/mocks) | ||
|
||
list(APPEND MOCK_REPLACEMENTS fwk_module) | ||
list(APPEND MOCK_REPLACEMENTS fwk_id) | ||
list(APPEND MOCK_REPLACEMENTS fwk_core) | ||
|
||
include(${SCP_ROOT}/unit_test/module_common.cmake) | ||
|
||
target_compile_definitions(${UNIT_TEST_TARGET} PUBLIC "BUILD_HAS_MOD_POWER_DOMAIN") |
35 changes: 35 additions & 0 deletions
35
module/scmi_power_domain/test/config_scmi_power_domain_ut.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Arm SCP/MCP Software | ||
* Copyright (c) 2024, Arm Limited and Contributors. All rights reserved. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
* | ||
* Description: | ||
* SCMI System Power unit test configuration. | ||
*/ | ||
|
||
#include <Mockmod_scmi_power_domain_extra.h> | ||
|
||
#include <mod_power_domain.h> | ||
#include <mod_scmi.h> | ||
#include <mod_scmi_power_domain.h> | ||
|
||
static struct mod_pd_restricted_api pd_api_ut = { | ||
.get_domain_type = get_domain_type, | ||
.get_domain_parent_id = get_domain_parent_id, | ||
.set_state = set_state, | ||
.get_state = get_state, | ||
.reset = reset, | ||
.system_suspend = system_suspend, | ||
.system_shutdown = system_shutdown, | ||
}; | ||
|
||
struct mod_scmi_from_protocol_api from_protocol_api = { | ||
.get_agent_count = mod_scmi_from_protocol_api_get_agent_count, | ||
.get_agent_id = mod_scmi_from_protocol_api_get_agent_id, | ||
.get_agent_type = mod_scmi_from_protocol_api_get_agent_type, | ||
.get_max_payload_size = mod_scmi_from_protocol_api_get_max_payload_size, | ||
.write_payload = mod_scmi_from_protocol_api_write_payload, | ||
.respond = mod_scmi_from_protocol_api_respond, | ||
.notify = mod_scmi_from_protocol_api_notify, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Arm SCP/MCP Software | ||
* Copyright (c) 2024, Arm Limited and Contributors. All rights reserved. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
#ifndef TEST_FWK_MODULE_MODULE_IDX_H | ||
#define TEST_FWK_MODULE_MODULE_IDX_H | ||
|
||
#include <fwk_id.h> | ||
|
||
enum fwk_module_idx { | ||
FWK_MODULE_IDX_SCMI_POWER_DOMAIN, | ||
FWK_MODULE_IDX_SCMI, | ||
FWK_MODULE_IDX_POWER_DOMAIN, | ||
FWK_MODULE_IDX_COUNT, | ||
}; | ||
|
||
static const fwk_id_t fwk_module_id_scmi_power_domain = | ||
FWK_ID_MODULE_INIT(FWK_MODULE_IDX_SCMI_POWER_DOMAIN); | ||
|
||
static const fwk_id_t fwk_module_id_scmi = | ||
FWK_ID_MODULE_INIT(FWK_MODULE_IDX_SCMI); | ||
|
||
static const fwk_id_t fwk_module_id_power_domain = | ||
FWK_ID_MODULE_INIT(FWK_MODULE_IDX_POWER_DOMAIN); | ||
|
||
#endif /* TEST_FWK_MODULE_MODULE_IDX_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"DisableFormat": true, | ||
"SortIncludes": false, | ||
} |
Oops, something went wrong.