Changeset fafa9e2 in rtems-libbsd


Ignore:
Timestamp:
Nov 13, 2013, 4:20:01 PM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, b96abfd647154f10ea8f7fac68e25676636eded5, debc0aed8b9bef9996b8ec0ae7a70b0b41912e27, 68e79b6d187fe09b0a6f3f1d22c69b4121a3f76e, freebsd-9.3, 33bfaee89aa71d2252eb48d6b9a9ec17183faced
Children:
6ab78d6
Parents:
c2f6513
git-author:
Sebastian Huber <sebastian.huber@…> (11/13/13 16:20:01)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/13/13 16:44:40)
Message:

testsuite: Simplify tests

Location:
testsuite
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • testsuite/commands01/test_main.c

    rc2f6513 rfafa9e2  
    4141
    4242#include <rtems/libcsupport.h>
    43 #include <rtems/stackchk.h>
    4443
    4544#define TEST_NAME "LIBBSD COMMANDS 1"
    4645
    4746#define ARGC(x) (nitems(x) - 1)
    48 
    49 static void
    50 set_self_prio(rtems_task_priority prio)
    51 {
    52         rtems_status_code sc;
    53 
    54         sc = rtems_task_set_priority(RTEMS_SELF, prio, &prio);
    55         assert(sc == RTEMS_SUCCESSFUL);
    56 }
    5747
    5848static void
     
    271261test_main(void)
    272262{
    273         /*
    274          * Let other tasks run to complete background work that frees allocated
    275          * resources.
    276          */
    277         set_self_prio(RTEMS_MAXIMUM_PRIORITY - 1);
    278 
    279263        test_route_without_if();
    280264        test_ifconfig_lo0();
     
    284268        test_netstat();
    285269
    286         rtems_stack_checker_report_usage_with_plugin(NULL,
    287             rtems_printf_plugin);
    288 
    289         puts("*** END OF " TEST_NAME " TEST ***");
    290270        exit(0);
    291271}
  • testsuite/include/rtems/bsd/test/default-init.h

    rc2f6513 rfafa9e2  
    77
    88#include <bsp.h>
     9#include <assert.h>
    910#include <stdlib.h>
    1011#include <stdio.h>
     12#include <rtems/stackchk.h>
    1113#include <rtems/bsd/bsd.h>
     14
     15static void default_set_self_prio( rtems_task_priority prio )
     16{
     17  rtems_status_code sc;
     18
     19  sc = rtems_task_set_priority(RTEMS_SELF, prio, &prio);
     20  assert(sc == RTEMS_SUCCESSFUL);
     21}
     22
     23static void default_on_exit( int exit_code, void *arg )
     24{
     25  rtems_stack_checker_report_usage_with_plugin(
     26    NULL,
     27    rtems_printf_plugin
     28  );
     29
     30  if ( exit_code == 0 ) {
     31    puts( "*** END OF TEST " TEST_NAME " ***" );
     32  }
     33}
    1234
    1335rtems_task Init(
     
    1537)
    1638{
     39  rtems_status_code sc;
     40
    1741  puts( "*** " TEST_NAME " TEST ***" );
    1842
     
    2347   */
    2448
     49  on_exit( default_on_exit, NULL );
     50
     51  /* Let other tasks run to complete background work */
     52  default_set_self_prio( RTEMS_MAXIMUM_PRIORITY - 1 );
     53
    2554  rtems_bsd_initialize_with_interrupt_server();
     55
     56  /* Let the callout timer allocate its resources */
     57  sc = rtems_task_wake_after( 2 );
     58  assert(sc == RTEMS_SUCCESSFUL);
    2659
    2760  test_main();
    2861  /* should not return */
    2962
    30   printf( "*** Test main returned and should not have ***\n" );
    31   exit( 5 );
     63  assert( 0 );
    3264}
    3365
  • testsuite/init01/test_main.c

    rc2f6513 rfafa9e2  
    1515  sleep( 5 );
    1616
    17   puts( "*** END OF " TEST_NAME " TEST ***" );
    1817  exit( 0 );
    1918}
  • testsuite/loopback01/test_main.c

    rc2f6513 rfafa9e2  
    296296  waitForClientEvents(argToClientEvent(4) | argToClientEvent(5) | argToClientEvent(6));
    297297
    298   puts( "*** END OF " TEST_NAME " TEST ***" );
    299298  exit( 0 );
    300299}
  • testsuite/netshell01/test_main.c

    rc2f6513 rfafa9e2  
    2323  rtems_shell_main_loop( &env );
    2424
    25   puts( "*** END OF " TEST_NAME " TEST ***" );
    2625  exit( 0 );
    2726}
  • testsuite/rwlock01/test_main.c

    rc2f6513 rfafa9e2  
    4444
    4545#include <rtems/libcsupport.h>
    46 #include <rtems/stackchk.h>
    4746#include <rtems.h>
    4847
     
    507506alloc_basic_resources(void)
    508507{
    509         rtems_status_code sc;
    510 
    511508        curthread;
    512 
    513         sc = rtems_task_wake_after(2);
    514         assert(sc == RTEMS_SUCCESSFUL);
    515509}
    516510
     
    549543        assert(rtems_resource_snapshot_check(&snapshot_0));
    550544
    551         rtems_stack_checker_report_usage_with_plugin(NULL,
    552             rtems_printf_plugin);
    553 
    554         puts("*** END OF " TEST_NAME " TEST ***");
    555545        exit(0);
    556546}
  • testsuite/selectpollkqueue01/test_main.c

    rc2f6513 rfafa9e2  
    5454
    5555#include <rtems/libcsupport.h>
    56 #include <rtems/stackchk.h>
    5756#include <rtems.h>
    5857
     
    988987        test_kqueue_close(ctx);
    989988
    990         rtems_stack_checker_report_usage_with_plugin(NULL,
    991             rtems_printf_plugin);
    992 
    993         puts("*** END OF " TEST_NAME " TEST ***");
    994989        exit(0);
    995990}
  • testsuite/sleep01/test_main.c

    rc2f6513 rfafa9e2  
    4444
    4545#include <rtems/libcsupport.h>
    46 #include <rtems/stackchk.h>
    4746
    4847#define TEST_NAME "LIBBSD SLEEP 1"
     
    210209alloc_basic_resources(void)
    211210{
    212         rtems_status_code sc;
    213 
    214211        curthread;
    215 
    216         sc = rtems_task_wake_after(2);
    217         assert(sc == RTEMS_SUCCESSFUL);
    218212}
    219213
     
    235229        assert(rtems_resource_snapshot_check(&snapshot));
    236230
    237         rtems_stack_checker_report_usage_with_plugin(NULL,
    238             rtems_printf_plugin);
    239 
    240         puts("*** END OF " TEST_NAME " TEST ***");
    241231        exit(0);
    242232}
  • testsuite/syscalls01/test_main.c

    rc2f6513 rfafa9e2  
    17191719        test_err();
    17201720
    1721         puts("*** END OF " TEST_NAME " TEST ***");
    17221721        exit(0);
    17231722}
  • testsuite/thread01/test_main.c

    rc2f6513 rfafa9e2  
    284284test_main(void)
    285285{
    286         rtems_status_code sc;
    287         rtems_task_priority prio = RTEMS_MAXIMUM_PRIORITY - 1;
    288 
    289286        main_task_id = rtems_task_self();
    290 
    291         sc = rtems_task_set_priority(RTEMS_SELF, prio, &prio);
    292         assert(sc == RTEMS_SUCCESSFUL);
    293287
    294288        test_non_bsd_thread();
     
    298292        test_rtems_bsd_get_curthread_or_null();
    299293
    300         puts("*** END OF " TEST_NAME " TEST ***");
    301294        exit(0);
    302295}
Note: See TracChangeset for help on using the changeset viewer.