本文整理汇总了C++中rtems_test_exit函数的典型用法代码示例。如果您正苦于以下问题:C++ rtems_test_exit函数的具体用法?C++ rtems_test_exit怎么用?C++ rtems_test_exit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rtems_test_exit函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 );
}
开发者ID:AlexShiLucky,项目名称:rtems,代码行数:17,代码来源:task1.c
示例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);
}
开发者ID:Dipupo,项目名称:rtems,代码行数:17,代码来源:init.c
示例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 */
}
开发者ID:AlexShiLucky,项目名称:rtems,代码行数:46,代码来源:task.c
示例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 );
}
开发者ID:Fyleo,项目名称:rtems,代码行数:17,代码来源:task1.c
示例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);
}
开发者ID:Avanznow,项目名称:rtems,代码行数:46,代码来源:init.c
示例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 );
}
开发者ID:greenmeent,项目名称:rtems,代码行数:17,代码来源:init.c
示例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);
}
开发者ID:gedare,项目名称:rtems,代码行数:17,代码来源:init.c
示例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);
}
开发者ID:epicsdeb,项目名称:rtems,代码行数:17,代码来源:init.c
示例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 );
}
开发者ID:FullMentalPanic,项目名称:RTEMS_NEW_TOOL_CHAIN,代码行数:46,代码来源:init.c
示例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 );
}
开发者ID:cloud-hot,项目名称:rtems,代码行数:17,代码来源:task1.c
示例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);
}
开发者ID:Avanznow,项目名称:rtems,代码行数:17,代码来源:init.c
示例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);
}
开发者ID:aniwang2013,项目名称:leon-rtems,代码行数:46,代码来源:init.c
示例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);
}
开发者ID:chch1028,项目名称:rtems,代码行数:45,代码来源:init.c
示例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 */
}
}
开发者ID:AlexShiLucky,项目名称:rtems,代码行数:45,代码来源:init.c
示例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);
}
开发者ID:Avanznow,项目名称:rtems,代码行数:45,代码来源:init.c
示例16: Init
rtems_task Init(
rtems_task_argument argument
)
{
int i;
char ch;
int cpu_num;
rtems_id id;
rtems_status_code status;
locked_print_initialize();
locked_printf( "\n\n*** TEST SMP09 ***\n" );
for ( killtime=0; killtime<1000000; killtime++ )
;
for ( i=0; i<rtems_smp_get_number_of_processors() -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 = bsp_smp_processor_id();
locked_printf(" CPU %d 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();
locked_printf( "*** END OF TEST SMP09 ***" );
rtems_test_exit(0);
}
开发者ID:0871087123,项目名称:rtems,代码行数:45,代码来源:init.c
示例17: Init
static void Init(rtems_task_argument arg)
{
rtems_resource_snapshot snapshot;
TEST_BEGIN();
rtems_resource_snapshot_take(&snapshot);
test_task_get_set_affinity();
test_task_get_set_scheduler();
test_scheduler_ident();
test_scheduler_get_processors();
rtems_test_assert(rtems_resource_snapshot_check(&snapshot));
TEST_END();
rtems_test_exit(0);
}
开发者ID:AlexShiLucky,项目名称:rtems,代码行数:18,代码来源:init.c
示例18: Task_2
rtems_task Task_2(
rtems_task_argument argument
)
{
while ( !testsFinished );
showTaskSwitches ();
puts( "" );
rtems_cpu_usage_report();
puts( "" );
puts( "TA2 - RESETTING USAGE STATISTICS" );
rtems_cpu_usage_reset();
puts( "" );
rtems_cpu_usage_report();
puts( "" );
puts( "*** END OF CPU USAGE LIBRARY TEST ***" );
rtems_test_exit( 0 );
}
开发者ID:FullMentalPanic,项目名称:RTEMS_NEW_TOOL_CHAIN,代码行数:18,代码来源:task2.c
示例19: check_isr_worked
void check_isr_worked(
char *s,
int result
)
{
switch (result) {
case -1:
printf( "isr_in_progress(%s) timer did not fire\n", s );
break;
case 1:
printf( "isr_in_progress(%s) from ISR -- OK\n", s );
break;
case 2:
printf( "isr_in_progress(%s) from ISR -- returned bad value\n", s);
rtems_test_exit(0);
break;
}
}
开发者ID:lanzhongheng,项目名称:rtems,代码行数:18,代码来源:init.c
示例20: Init
rtems_task Init(
rtems_task_argument argument
)
{
rtems_time_of_day time;
rtems_status_code status;
TEST_BEGIN();
test_watchdog_static_init();
build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
status = rtems_clock_set( &time );
directive_failed( status, "rtems_clock_set" );
Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' );
status = rtems_task_create(
Task_name[ 1 ],
1,
RTEMS_MINIMUM_STACK_SIZE * 2,
RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES,
&Task_id[ 1 ]
);
directive_failed( status, "rtems_task_create of TA1" );
status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
directive_failed( status, "rtems_task_start of TA1" );
puts( "INIT - rtems_timer_create - creating timer 1" );
status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] );
directive_failed( status, "rtems_timer_create" );
printf( "INIT - timer 1 has id (0x%" PRIxrtems_id ")\n", Timer_id[ 1 ] );
status = rtems_task_delete( RTEMS_SELF );
directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
rtems_test_exit( 0 );
}
开发者ID:krohini1593,项目名称:rtems,代码行数:44,代码来源:init.c
注:本文中的rtems_test_exit函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论