Skip to content

Commit c780165

Browse files
LDong-ArmPatater
authored andcommitted
psa: Remove outdated macro checks in tests
The macros `TARGET_PSA` and `COMPONENT_PSA_SRV_IPC` no longer exist. The former is replaced by `COMPONENT_PSA` which is also a directory where the tests are located, so its check can be assumed true. The latter is not applicable to Mbed OS PSA and can be assumed false. Note: The entropy_inject test is skipped by default unless a user manually configures the required `MBEDTLS_ENTROPY_NV_SEED`.
1 parent 63531ec commit c780165

File tree

4 files changed

+9
-14
lines changed
  • platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/TESTS

4 files changed

+9
-14
lines changed

platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/TESTS/attestation/test/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323
#include "psa/crypto.h"
2424

25-
#if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C)))
26-
#error [NOT_SUPPORTED] Mbed Crypto is OFF - skipping.
25+
#if !defined(MBEDTLS_PSA_CRYPTO_C)
26+
#error [NOT_SUPPORTED] Mbed TLS PSA Crypto is OFF - skipping.
2727
#else
2828

2929
#include "greentea-client/test_env.h"
@@ -160,5 +160,5 @@ int main()
160160
return !Harness::run(specification);
161161
}
162162

163-
#endif // ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C)))
163+
#endif // !defined(MBEDTLS_PSA_CRYPTO_C)
164164
#endif // !defined(MBED_CONF_RTOS_PRESENT)

platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/TESTS/crypto_init/test/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
#include "psa/crypto.h"
2020

21-
#if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C)))
22-
#error [NOT_SUPPORTED] Mbed Crypto is OFF - skipping.
21+
#if !defined(MBEDTLS_PSA_CRYPTO_C)
22+
#error [NOT_SUPPORTED] Mbed TLS PSA Crypto is OFF - skipping.
2323
#else
2424

2525
#include "greentea-client/test_env.h"
@@ -87,4 +87,4 @@ int main()
8787
return !Harness::run(specification);
8888
}
8989

90-
#endif // ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C)))
90+
#endif // !defined(MBEDTLS_PSA_CRYPTO_C)

platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/TESTS/entropy_inject/test/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* limitations under the License.
1717
*/
1818

19-
#if ((!defined(TARGET_PSA) || (!defined(COMPONENT_PSA_SRV_IPC)) && !defined(MBEDTLS_ENTROPY_NV_SEED)))
20-
#error [NOT_SUPPORTED] PSA entropy injection tests can run only on PSA-enabled targets.
19+
#if !defined(MBEDTLS_ENTROPY_NV_SEED)
20+
#error [NOT_SUPPORTED] PSA entropy injection tests can run only with MBEDTLS_ENTROPY_NV_SEED enabled.
2121
#else
2222

2323
#include "greentea-client/test_env.h"
@@ -184,4 +184,4 @@ int main()
184184
return !Harness::run(specification);
185185
}
186186

187-
#endif // ((!defined(TARGET_PSA) || (!defined(COMPONENT_PSA_SRV_IPC)) && !defined(MBEDTLS_ENTROPY_NV_SEED)))
187+
#endif // !defined(MBEDTLS_ENTROPY_NV_SEED)

platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/TESTS/its_ps/test/main.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
#error [NOT_SUPPORTED] ITS/PS test cases require RTOS to run.
2121
#else
2222

23-
#ifndef TARGET_PSA
24-
#error [NOT_SUPPORTED] ITS/PS tests can run only on PSA-enabled targets.
25-
#else
26-
2723
#include "greentea-client/test_env.h"
2824
#include "unity/unity.h"
2925
#include "utest/utest.h"
@@ -243,5 +239,4 @@ int main()
243239
return !Harness::run(specification);
244240
}
245241

246-
#endif // TARGET_PSA
247242
#endif // !defined(MBED_CONF_RTOS_PRESENT)

0 commit comments

Comments
 (0)