2 #include "libtest_tests_internal.h"
8 /****************************************************************************/
9 #pragma warning( disable : 4100 4127 ) // TRD : disables MSVC warning for condition expressions being const
11 void libtest_tests_queue_umm_alignment( struct lfds710_list_asu_state *list_of_logical_processors, struct libshared_memory_state *ms, enum lfds710_misc_validity *dvs )
13 /* TRD : these are compile time checks
14 but we do them here because this is a test programme
15 and it should indicate issues to users when it is *run*,
16 not when it is compiled, because a compile error normally
17 indicates a problem with the code itself and so is misleading
20 LFDS710_PAL_ASSERT( list_of_logical_processors != NULL );
21 LFDS710_PAL_ASSERT( ms != NULL );
22 LFDS710_PAL_ASSERT( dvs != NULL );
24 *dvs = LFDS710_MISC_VALIDITY_VALID;
26 // TRD : struct lfds710_queue_umm_element
27 if( LIBTEST_MISC_OFFSETOF(struct lfds710_queue_umm_element,next) % LFDS710_PAL_ALIGN_DOUBLE_POINTER != 0 )
28 *dvs = LFDS710_MISC_VALIDITY_INVALID_TEST_DATA;
32 // TRD : struct lfds710_queue_umm_state
33 if( LIBTEST_MISC_OFFSETOF(struct lfds710_queue_umm_state,enqueue) % LFDS710_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 )
34 *dvs = LFDS710_MISC_VALIDITY_INVALID_TEST_DATA;
36 if( LIBTEST_MISC_OFFSETOF(struct lfds710_queue_umm_state,dequeue) % LFDS710_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 )
37 *dvs = LFDS710_MISC_VALIDITY_INVALID_TEST_DATA;
39 if( LIBTEST_MISC_OFFSETOF(struct lfds710_queue_umm_state,aba_counter) % LFDS710_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 )
40 *dvs = LFDS710_MISC_VALIDITY_INVALID_TEST_DATA;
42 if( LIBTEST_MISC_OFFSETOF(struct lfds710_queue_umm_state,user_state) % LFDS710_PAL_ATOMIC_ISOLATION_IN_BYTES != 0 )
43 *dvs = LFDS710_MISC_VALIDITY_INVALID_TEST_DATA;
48 #pragma warning( default : 4100 4127 )