diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-09 09:40:43 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-09 15:30:24 +0200 |
commit | 2d5424d2d04a923580e526572fd996b65a031bd6 (patch) | |
tree | 0928f3cde88c50eed1155e18239cad03777c14a7 /testsuites/sptests/sp37 | |
parent | smptests/smpschedule01: Rename in smpscheduler01 (diff) | |
download | rtems-2d5424d2d04a923580e526572fd996b65a031bd6.tar.bz2 |
sptests/sp37: Account for internal struct align
Diffstat (limited to 'testsuites/sptests/sp37')
-rw-r--r-- | testsuites/sptests/sp37/init.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/testsuites/sptests/sp37/init.c b/testsuites/sptests/sp37/init.c index abe72d1f53..be0bd3225e 100644 --- a/testsuites/sptests/sp37/init.c +++ b/testsuites/sptests/sp37/init.c @@ -159,6 +159,14 @@ static void test_isr_level( void ) test_isr_level_for_new_threads( last_proper_level ); } +#if defined(RTEMS_SMP) && defined(RTEMS_PROFILING) +static const size_t lock_size = + offsetof( ISR_lock_Control, lock.ticket_lock.Stats.name ) + + sizeof( ((ISR_lock_Control *) 0)->lock.ticket_lock.Stats.name ); +#else +static const size_t lock_size = sizeof( ISR_lock_Control ); +#endif + static void test_isr_locks( void ) { ISR_Level normal_interrupt_level = _ISR_Get_level(); @@ -167,7 +175,7 @@ static void test_isr_locks( void ) ISR_lock_Context lock_context; _ISR_lock_Initialize( &lock, "test" ); - rtems_test_assert( memcmp( &lock, &initialized, sizeof( lock ) ) == 0 ); + rtems_test_assert( memcmp( &lock, &initialized, lock_size ) == 0 ); _ISR_lock_ISR_disable_and_acquire( &lock, &lock_context ); rtems_test_assert( normal_interrupt_level != _ISR_Get_level() ); @@ -204,7 +212,7 @@ static void test_interrupt_locks( void ) rtems_interrupt_lock_context lock_context; rtems_interrupt_lock_initialize( &lock, "test" ); - rtems_test_assert( memcmp( &lock, &initialized, sizeof( lock ) ) == 0 ); + rtems_test_assert( memcmp( &lock, &initialized, lock_size ) == 0 ); rtems_interrupt_lock_acquire( &lock, &lock_context ); rtems_test_assert( normal_interrupt_level != get_interrupt_level() ); |