2 #include "libtest_tests_internal.h"
8 /****************************************************************************/
9 #pragma warning( disable : 4100 )
11 void libtest_tests_queue_bss_dequeuing( struct lfds710_list_asu_state *list_of_logical_processors, struct libshared_memory_state *ms, enum lfds710_misc_validity *dvs )
16 struct lfds710_queue_bss_element
19 struct lfds710_queue_bss_state
22 struct lfds710_misc_validation_info
28 LFDS710_PAL_ASSERT( list_of_logical_processors != NULL );
29 LFDS710_PAL_ASSERT( ms != NULL );
30 LFDS710_PAL_ASSERT( dvs != NULL );
32 /* TRD : create an empty queue
34 then dequeue the elements, in the same thread - we're API testing
35 it's a single producer queue, so we just do this in our current thread
36 since we're enqueuing and dequeuing in the same thread
39 *dvs = LFDS710_MISC_VALIDITY_VALID;
41 lfds710_queue_bss_init_valid_on_current_logical_core( &qs, element_array, 128, NULL );
43 for( loop = 0 ; loop < 127 ; loop++ )
44 lfds710_queue_bss_enqueue( &qs, NULL, (void *) loop );
46 for( loop = 0 ; loop < 127 ; loop++ )
48 lfds710_queue_bss_dequeue( &qs, NULL, &value );
49 if( (lfds710_pal_uint_t) value != 127 - loop )
50 *dvs = LFDS710_MISC_VALIDITY_INVALID_TEST_DATA;
53 vi.min_elements = vi.max_elements = 0;
55 lfds710_queue_bss_query( &qs, LFDS710_QUEUE_BSS_QUERY_VALIDATE, &vi, dvs );
57 lfds710_queue_bss_cleanup( &qs, NULL );
62 #pragma warning( default : 4100 )