本文整理汇总了C++中rtems_test_exit函数的典型用法代码示例。如果您正苦于以下问题:C++ rtems_test_exit函数的具体用法?C++ rtems_test_exit怎么用?C++ rtems_test_exit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rtems_test_exit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Low_task
rtems_task Low_task(
rtems_task_argument argument
)
{
end_time = benchmark_timer_read();
put_time(
"rtems_task_wake_when: only case",
end_time,
operation_count,
0,
CALLING_OVERHEAD_TASK_WAKE_WHEN
);
TEST_END();
rtems_test_exit( 0 );
}
示例2: Init
static void Init(rtems_task_argument arg)
{
rtems_resource_snapshot snapshot;
TEST_BEGIN();
rtems_resource_snapshot_take(&snapshot);
if (rtems_get_processor_count() == CPU_COUNT) {
test();
}
rtems_test_assert(rtems_resource_snapshot_check(&snapshot));
TEST_END();
rtems_test_exit(0);
}
示例3: puts
void *Task_1_through_3(
void *argument
)
{
int status;
puts( "Task_1: sched_yield to Init" );
status = sched_yield();
rtems_test_assert( !status );
/* switch to Task_1 */
/* now do some real testing */
empty_line();
/* get id of this thread */
Task_id = pthread_self();
printf( "Task_1: ID is 0x%08" PRIxpthread_t "\n", Task_id );
/* exercise pthread_equal */
status = pthread_equal( Task_id, Task_id );
if ( status )
puts( "Task_1: pthread_equal - match case passed" );
rtems_test_assert( status );
status = pthread_equal( Init_id, Task_id );
if ( !status )
puts( "Task_1: pthread_equal - different case passed" );
rtems_test_assert( !status );
puts( "Task_1: pthread_equal - first id bad" );
status = pthread_equal( (pthread_t) -1, Task_id );
rtems_test_assert( !status );
puts( "Task_1: pthread_equal - second id bad" );
status = pthread_equal( Init_id, (pthread_t) -1 );
rtems_test_assert( !status );
TEST_END();
rtems_test_exit( 0 );
return NULL; /* just so the compiler thinks we returned something */
}
示例4: Low_task
rtems_task Low_task(
rtems_task_argument argument
)
{
end_time = benchmark_timer_read();
put_time(
"rtems_semaphore_obtain: not available caller blocks",
end_time,
operation_count - 1,
0,
CALLING_OVERHEAD_SEMAPHORE_OBTAIN
);
TEST_END();
rtems_test_exit( 0 );
}
示例5: Init
rtems_task Init(
rtems_task_argument argument
)
{
uint32_t i;
char ch;
uint32_t cpu_num;
rtems_id id;
rtems_status_code status;
TEST_BEGIN();
locked_print_initialize();
for ( killtime=0; killtime<1000000; killtime++ )
;
for ( i=0; i<rtems_get_processor_count() -1; i++ ) {
ch = '1' + i;
status = rtems_task_create(
rtems_build_name( 'T', 'A', ch, ' ' ),
1,
RTEMS_MINIMUM_STACK_SIZE,
RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES,
&id
);
directive_failed( status, "task create" );
cpu_num = rtems_get_current_processor();
locked_printf(" CPU %" PRIu32 " start task TA%c\n", cpu_num, ch);
status = rtems_task_start( id, Test_task, i+1 );
directive_failed( status, "task start" );
}
locked_printf(" kill 10 clock ticks\n" );
while ( rtems_clock_get_ticks_since_boot() < 10 )
;
rtems_cpu_usage_report();
TEST_END();
rtems_test_exit(0);
}
示例6: Init
rtems_task Init(
rtems_task_argument argument
)
{
TEST_BEGIN();
do_putk();
putk("");
do_printk();
putk("");
do_getchark();
TEST_END();
rtems_test_exit( 0 );
}
示例7: Init
static void Init(rtems_task_argument arg)
{
int sc;
TEST_BEGIN();
/* Initialize thread id */
sc = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &Init_id );
directive_failed( sc, "Identify Init Task" );
Validate_setaffinity_errors();
Validate_getaffinity_errors();
Validate_affinity();
TEST_END();
rtems_test_exit(0);
}
示例8: Init
rtems_task Init(
rtems_task_argument argument
)
{
puts( "\n\n*** HEAP WALK TEST ***" );
test_system_not_up();
test_check_control();
test_check_free_list();
test_freshly_initialized();
test_main_loop();
test_check_free_block();
test_output();
puts( "*** END OF HEAP WALK TEST ***" );
rtems_test_exit(0);
}
示例9: Init
rtems_task Init(
rtems_task_argument argument
)
{
void *p1;
bool retbool;
Heap_Information_block info;
puts( "\n\n*** TEST WORKSPACE CLASSIC API ***" );
puts( "rtems_workspace_get_information - null pointer" );
retbool = rtems_workspace_get_information( NULL );
rtems_test_assert( retbool == false );
puts( "rtems_workspace_get_information - OK" );
retbool = rtems_workspace_get_information( &info );
rtems_test_assert( retbool == true );
puts( "rtems_workspace_allocate - null pointer" );
retbool = rtems_workspace_allocate( 42, NULL );
rtems_test_assert( retbool == false );
puts( "rtems_workspace_allocate - 0 bytes" );
retbool = rtems_workspace_allocate( 0, &p1 );
rtems_test_assert( retbool == false );
puts( "rtems_workspace_allocate - too many bytes" );
retbool = rtems_workspace_allocate( info.Free.largest * 2, &p1 );
rtems_test_assert( retbool == false );
puts( "rtems_workspace_allocate - 42 bytes" );
retbool = rtems_workspace_allocate( 42, &p1 );
rtems_test_assert( retbool == true );
rtems_test_assert( p1 != NULL );
puts( "rtems_workspace_free - NULL" );
retbool = rtems_workspace_free( NULL );
rtems_test_assert( retbool == false );
puts( "rtems_workspace_free - previous pointer to 42 bytes" );
retbool = rtems_workspace_free( p1 );
rtems_test_assert( retbool == true );
puts( "*** END OF TEST WORKSPACE CLASSIC API ***" );
rtems_test_exit( 0 );
}
示例10: Low_task
rtems_task Low_task(
rtems_task_argument argument
)
{
end_time = benchmark_timer_read();
put_time(
"rtems_message_queue_receive: not available caller blocks",
end_time,
operation_count - 1,
0,
CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE
);
puts( "*** END OF TEST 10 ***" );
rtems_test_exit( 0 );
}
示例11: inversion_task
static void inversion_task(rtems_task_argument arg)
{
test_context *ctx = &test_instance;
/*
* Here we see that the priority of the high priority task blocked on
* semaphore B doesn't propagate to the low priority task owning semaphore A
* on which the owner of semaphore B depends.
*/
assert_prio(ctx->low, 3);
assert_prio(ctx->mid, 1);
assert_prio(ctx->high, 1);
assert_prio(ctx->inversion, 2);
TEST_END();
rtems_test_exit(0);
}
示例12: puts
void *POSIX_Init(
rtems_task_argument argument
)
{
int status;
puts( "\n\n*** POSIX TEST SIGNAL 06 ***" );
puts( "Init: pthread_cond_init - OK" );
status = pthread_cond_init( &CondVarId, NULL );
rtems_test_assert( !status );
puts( "Init: pthread_mutex_init - OK" );
status = pthread_mutex_init( &MutexId, NULL );
rtems_test_assert( !status );
puts( "Init: pthread_create - OK" );
status = pthread_create( &ThreadId, NULL, TestThread, NULL );
rtems_test_assert( !status );
sleep( 1 );
/* let TestThread run */
puts( "Init: pthread_kill - SIGUSR to Test Thread - OK" );
status = pthread_kill( ThreadId, SIGUSR1 );
rtems_test_assert( !status );
sleep( 2 );
/* let TestThread run */
puts( "Init: pthread_kill - SIGUSR to Test Thread - OK" );
status = pthread_kill( ThreadId, SIGUSR1 );
rtems_test_assert( !status );
sleep( 1 );
/* let TestThread run */
puts( "*** END OF POSIX TEST SIGNAL 06 ***" );
rtems_test_exit(0);
}
示例13: puts
void *POSIX_Init(
void *ignored
)
{
pthread_key_t key1, key2;
int sc, *value;
int Data_array[2] = {1, 2};
puts( "\n\n*** TEST KEY 05 ***" );
puts( "Init - pthread key1 create - OK" );
sc = pthread_key_create( &key1, NULL );
rtems_test_assert( !sc );
puts( "Init - pthread key2 create - OK" );
sc = pthread_key_create( &key2, NULL );
rtems_test_assert( !sc );
puts( "Init - key1 pthread_setspecific - OK" );
sc = pthread_setspecific( key1, &Data_array[0] );
rtems_test_assert( !sc );
puts( "Init - key2 pthread_setspecific - OK" );
sc = pthread_setspecific( key2, &Data_array[1] );
rtems_test_assert( !sc );
puts( "Init - key1 pthread_getspecific - OK" );
value = pthread_getspecific( key1 );
rtems_test_assert( *value == Data_array[0] );
puts( "Init - key2 pthread_getspecific - OK" );
value = pthread_getspecific( key2 );
rtems_test_assert( *value == Data_array[1] );
puts( "Init - pthread key1 delete - OK" );
sc = pthread_key_delete( key1 );
rtems_test_assert( sc == 0 );
puts( "Init - pthread key2 delete - OK" );
sc = pthread_key_delete( key2 );
rtems_test_assert( sc == 0 );
puts( "*** END OF TEST KEY 05 ***" );
rtems_test_exit(0);
}
示例14: Init
rtems_task Init(
rtems_task_argument argument
)
{
rtems_status_code sc;
rtems_id timer1;
struct timespec uptime;
TEST_BEGIN();
sc = rtems_timer_initiate_server(
1,
RTEMS_MINIMUM_STACK_SIZE,
RTEMS_DEFAULT_ATTRIBUTES
);
directive_failed( sc, "rtems_timer_initiate_server" );
sc = rtems_timer_create(rtems_build_name( 'T', 'M', 'R', '1' ), &timer1);
directive_failed( sc, "rtems_timer_create" );
Fired = 0;
timerRan = false;
Timer_Routine(timer1, NULL);
while (1) {
sc = rtems_task_wake_after( 10 );
directive_failed( sc, "rtems_task_wake_after" );
if ( timerRan == true ) {
timerRan = false;
sc = rtems_clock_get_uptime( &uptime );
directive_failed( sc, "rtems_clock_get_uptime" );
printf( "Timer fired at %" PRIdtime_t "\n", uptime.tv_sec );
}
if ( Fired >= 10 ) {
TEST_END();
rtems_test_exit( 0 );
}
/* technically the following is a critical section */
}
}
示例15: Init
static void Init(rtems_task_argument ignored)
{
test_context *ctx = &ctx_instance;
rtems_status_code sc;
TEST_BEGIN();
ctx->master_task = rtems_task_self();
sc = rtems_semaphore_create(
rtems_build_name('S', 'E', 'M', 'A'),
1,
RTEMS_COUNTING_SEMAPHORE,
0,
&ctx->semaphore_id
);
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
sc = rtems_task_create(
rtems_build_name('S', 'E', 'M', 'A'),
PRIORITY_SEMAPHORE,
RTEMS_MINIMUM_STACK_SIZE,
RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES,
&ctx->semaphore_task
);
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
sc = rtems_task_start(
ctx->semaphore_task,
semaphore_task,
(rtems_task_argument) ctx
);
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
interrupt_critical_section_test(test_body, ctx, release_semaphore);
rtems_test_assert(ctx->thread_queue_was_null);
rtems_test_assert(ctx->status_was_successful);
rtems_test_assert(ctx->status_was_timeout);
TEST_END();
rtems_test_exit(0);
}