source: rtems/testsuites/sptests/sp71/init.c @ c4b8b147

5
Last change on this file since c4b8b147 was c4b8b147, checked in by Sebastian Huber <sebastian.huber@…>, on 11/03/17 at 07:35:38

tests: Use simple console driver

Update #3170.
Update #3199.

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2012.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.org/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include <tmacros.h>
15#include "test_support.h"
16
17const char rtems_test_name[] = "SP 71";
18
19#define PER_ALLOCATION 8000
20
21/* forward declarations to avoid warnings */
22rtems_task Init(rtems_task_argument argument);
23
24rtems_task Init(
25  rtems_task_argument argument
26)
27{
28  rtems_status_code status;
29  rtems_id          id;
30  long              created;
31
32  TEST_BEGIN();
33
34  created = 0;
35  do {
36    status = rtems_port_create(
37      rtems_build_name( 'P', 'O', 'R', 'T' ),
38      (void *) 0x1000,
39      (void *) 0x2000,
40      1024,
41      &id
42    );
43    if ( status == RTEMS_TOO_MANY )
44      break;
45    directive_failed( status, "rtems_task_create" );
46    created++;
47  } while (1);
48
49  printf(
50    "%ld ports created using %d per allocation -- need %ld\n",
51    created,
52    PER_ALLOCATION,
53    (long) OBJECTS_ID_FINAL_INDEX
54  );
55
56  if ( (created + PER_ALLOCATION) > OBJECTS_ID_FINAL_INDEX ) {
57    puts( "Test case hit" );
58    TEST_END();
59  } else {
60    puts( "Test case NOT hit" );
61  }
62  rtems_test_exit(0);
63}
64
65/* configuration information */
66
67#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
68#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
69
70#define CONFIGURE_MAXIMUM_TASKS             1
71#define CONFIGURE_MAXIMUM_PORTS rtems_resource_unlimited(PER_ALLOCATION)
72#define CONFIGURE_UNIFIED_WORK_AREAS
73#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
74
75#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
76
77#define CONFIGURE_INIT
78
79#include <rtems/confdefs.h>
80/* end of file */
Note: See TracBrowser for help on using the repository browser.