diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-04-20 12:48:15 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-04-20 12:48:15 +0200 |
commit | cce780146b83176aacf422d7a112c533d8123e01 (patch) | |
tree | f02a3ec687b28ea01d0af6496782ef4d061bc172 | |
parent | d8cf76c113dbeaf922246f4607d04fd64b22be6c (diff) |
testsuites/validation/tc-space-profile.cqual-21
-rw-r--r-- | testsuites/validation/tc-space-profile.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/testsuites/validation/tc-space-profile.c b/testsuites/validation/tc-space-profile.c index ceb0780ce2..712d125aaf 100644 --- a/testsuites/validation/tc-space-profile.c +++ b/testsuites/validation/tc-space-profile.c @@ -70,7 +70,9 @@ * * This test case performs the following actions: * - * - Allocate four bytes with an alignment of 128 bytes with aligned_alloc(). + * - Allocate four bytes with an alignment of 128 bytes with posix_memalign(). + * + * - Check that the returned status is zero. * * - Check that the returned pointer is not NULL. * @@ -94,23 +96,30 @@ /** * @brief Allocate four bytes with an alignment of 128 bytes with - * aligned_alloc(). + * posix_memalign(). */ static void TestsuitesValidationCLibrary_Action_0( void ) { void *p; + int eno; - p = aligned_alloc(128, 4); + p = (void *)(uintptr_t) 1; + eno = posix_memalign(&p, 128, 4); + + /* + * Check that the returned status is zero. + */ + T_step_eq_int(0, eno, 0); /* * Check that the returned pointer is not NULL. */ - T_step_not_null(0, p); + T_step_not_null(1, p); /* * Check that the returned pointer is aligned by 128 bytes. */ - T_step_eq_uptr(1, (uintptr_t) p % 128, 0); + T_step_eq_uptr(2, (uintptr_t) p % 128, 0); } /** @@ -125,7 +134,7 @@ static void TestsuitesValidationCLibrary_Action_1( void ) /* * Check that the returned pointer is not NULL. */ - T_step_not_null(2, p); + T_step_not_null(3, p); } /** @@ -141,7 +150,7 @@ static void TestsuitesValidationCLibrary_Action_2( void ) /* * Check that the integer variable is equal to zero. */ - T_step_eq_int(3, d, 0); + T_step_eq_int(4, d, 0); } /** @@ -161,7 +170,7 @@ static void TestsuitesValidationCLibrary_Action_3( void ) /* * Check that the destination integer variable is equal to one. */ - T_step_eq_int(4, d, 1); + T_step_eq_int(5, d, 1); } /** @@ -169,7 +178,7 @@ static void TestsuitesValidationCLibrary_Action_3( void ) */ T_TEST_CASE( TestsuitesValidationCLibrary ) { - T_plan( 5 ); + T_plan( 6 ); TestsuitesValidationCLibrary_Action_0(); TestsuitesValidationCLibrary_Action_1(); |