Merge pull request #8829 from paul-elliott-arm/add_framework_meta_tests

Add metatests for failing TEST_EQUAL and TEST_LE_*
This commit is contained in:
Paul Elliott 2024-03-14 15:55:14 +00:00 committed by GitHub
commit 50da462fc8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -70,6 +70,41 @@ void meta_test_fail(const char *name)
mbedtls_test_fail("Forced test failure", __LINE__, __FILE__);
}
void meta_test_not_equal(const char *name)
{
int left = 20;
int right = 10;
(void) name;
TEST_EQUAL(left, right);
exit:
;
}
void meta_test_not_le_s(const char *name)
{
int left = 20;
int right = 10;
(void) name;
TEST_LE_S(left, right);
exit:
;
}
void meta_test_not_le_u(const char *name)
{
size_t left = 20;
size_t right = 10;
(void) name;
TEST_LE_U(left, right);
exit:
;
}
/****************************************************************/
/* Platform features */
@ -285,6 +320,9 @@ typedef struct {
*/
metatest_t metatests[] = {
{ "test_fail", "any", meta_test_fail },
{ "test_not_equal", "any", meta_test_not_equal },
{ "test_not_le_s", "any", meta_test_not_le_s },
{ "test_not_le_u", "any", meta_test_not_le_u },
{ "null_dereference", "any", null_pointer_dereference },
{ "null_call", "any", null_pointer_call },
{ "read_after_free", "asan", read_after_free },