PSA tests: use a few common test macros #2

Merged
gilles-peskine-arm merged 14 commits from psa-test_macros into development 2019-01-02 04:19:56 -06:00
gilles-peskine-arm commented 2018-12-18 01:58:08 -06:00 (Migrated from github.com)

Declare a few macros in helpers.function and use them in the PSA tests. I haven't touched non-PSA tests.

  • TEST_EQUAL (slightly more readable than TEST_ASSERT(a==b), but the real payoff will come later when we instrument it to print the values on failure)
  • PSA_ASSERT (TEST_ASSERT(…==PSA_SUCCESS))
  • ARRAY_LENGTH (with protection against usage on a pointer when compiling with GCC)
  • MIN, MAX

There's some refactoring going on, so I recommend reviewing commit by commit.

Declare a few macros in `helpers.function` and use them in the PSA tests. I haven't touched non-PSA tests. * `TEST_EQUAL` (slightly more readable than `TEST_ASSERT(a==b)`, but the real payoff will come later when we instrument it to print the values on failure) * `PSA_ASSERT` (`TEST_ASSERT(…==PSA_SUCCESS)`) * `ARRAY_LENGTH` (with protection against usage on a pointer when compiling with GCC) * `MIN`, `MAX` There's some refactoring going on, so I recommend reviewing commit by commit.
NirSonnenschein (Migrated from github.com) reviewed 2018-12-18 09:46:50 -06:00
NirSonnenschein (Migrated from github.com) left a comment
No description provided.
LGTM
Patater (Migrated from github.com) reviewed 2018-12-19 05:54:47 -06:00
Patater (Migrated from github.com) commented 2018-12-19 05:31:51 -06:00

Style: begin continued comment lines with a *.

Style: begin continued comment lines with a `*`.
Patater (Migrated from github.com) commented 2018-12-19 05:34:41 -06:00

Where is IS_ARRAY_NOT_POINTER defined for non GNUC platforms? Should STATIC_ASSERT_EXPR_IF_POSSIBLE instead be IS_ARRAY_NOT_POINTER? Where is STATIC_ASSERT_EXPR_IF_POSSIBLE used?

Where is `IS_ARRAY_NOT_POINTER` defined for non GNUC platforms? Should `STATIC_ASSERT_EXPR_IF_POSSIBLE` instead be `IS_ARRAY_NOT_POINTER`? Where is `STATIC_ASSERT_EXPR_IF_POSSIBLE` used?
gilles-peskine-arm (Migrated from github.com) reviewed 2018-12-20 11:48:34 -06:00
gilles-peskine-arm (Migrated from github.com) commented 2018-12-20 11:48:34 -06:00

Leftover from a slightly different design that I abandoned without committing. I have amended the corresponding commit.

Leftover from a slightly different design that I abandoned without committing. I have amended the corresponding commit.
gilles-peskine-arm (Migrated from github.com) reviewed 2018-12-20 11:48:43 -06:00
gilles-peskine-arm (Migrated from github.com) commented 2018-12-20 11:48:42 -06:00

Fixed in the amended commit.

Fixed in the amended commit.
gilles-peskine-arm commented 2018-12-20 11:49:42 -06:00 (Migrated from github.com)

I've amended the commit "Add a safety check to ARRAY_LENGTH" to address the issues that @Patater pointed out. Previous history at https://github.com/gilles-peskine-arm/mbed-crypto/tree/psa-test_macros-1

I've amended the commit "Add a safety check to ARRAY_LENGTH" to address the issues that @Patater pointed out. Previous history at https://github.com/gilles-peskine-arm/mbed-crypto/tree/psa-test_macros-1
Patater (Migrated from github.com) approved these changes 2018-12-21 04:21:55 -06:00
Patater (Migrated from github.com) left a comment

LGTM

LGTM
Patater commented 2018-12-21 04:22:43 -06:00 (Migrated from github.com)

CI failure is test_suite_timing on FreeBSD, a known issue.

CI failure is test_suite_timing on FreeBSD, a known issue.
gilles-peskine-arm commented 2018-12-21 04:28:56 -06:00 (Migrated from github.com)
Release job: https://jenkins-internal.mbed.com/job/mbedtls-psa-release-new/201/ → PASS
Patater commented 2018-12-21 07:09:06 -06:00 (Migrated from github.com)
Other half of the release job: https://jenkins-internal.mbed.com/job/mbedtls-psa-release-new/202/
Patater commented 2018-12-21 09:47:49 -06:00 (Migrated from github.com)

Basic build and test passed. Mbed OS testing went badly because the test is broke: not this PR's fault.

Basic build and test passed. Mbed OS testing went badly because the test is broke: not this PR's fault.
NirSonnenschein (Migrated from github.com) approved these changes 2018-12-23 03:43:16 -06:00
NirSonnenschein (Migrated from github.com) left a comment

re-checked after rebase - still look fine.

re-checked after rebase - still look fine.
Patater commented 2019-01-02 04:19:13 -06:00 (Migrated from github.com)

The test failure is the FreeBSD timing test, a known issue.

The test failure is the FreeBSD timing test, a known issue.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-ARMmbed/mbed-crypto!2
No description provided.