source: rtems/testsuites/samples/base_sp/init.c @ 98c6d50

5
Last change on this file since 98c6d50 was 98c6d50, checked in by Chris Johns <chrisj@…>, on 10/19/17 at 05:39:16

testsuite: Use printk for all test output where possible.

  • Remove the printf support leaving the direct printk support configured with TESTS_USE_PRINTK and all other output goes via a buffered vsniprintf call to printk.
  • Control the test's single init for functions and global data with TEST_INIT and not CONFIGURE_INIT. They are now separate.

Updates #3170.

  • Property mode set to 100644
File size: 1.2 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#define TEST_INIT
15
16#define CONFIGURE_INIT
17#include "system.h"
18#include "tmacros.h"
19#include <stdio.h>
20
21/* forward declarations to avoid warnings */
22rtems_task Init(rtems_task_argument argument);
23
24const char rtems_test_name[] = "SAMPLE SINGLE PROCESSOR APPLICATION";
25
26#define ARGUMENT 0
27
28rtems_task Init(
29  rtems_task_argument argument
30)
31{
32  rtems_name        task_name;
33  rtems_id          tid;
34  rtems_status_code status;
35
36  TEST_BEGIN();
37  printf( "Creating and starting an application task\n" );
38
39  task_name = rtems_build_name( 'T', 'A', '1', ' ' );
40
41  status = rtems_task_create( task_name, 1, RTEMS_MINIMUM_STACK_SIZE,
42             RTEMS_INTERRUPT_LEVEL(0), RTEMS_DEFAULT_ATTRIBUTES, &tid );
43  directive_failed( status, "create" );
44
45  status = rtems_task_start( tid, Application_task, ARGUMENT );
46  directive_failed( status, "start" );
47
48  status = rtems_task_delete( RTEMS_SELF );
49  directive_failed( status, "delete" );
50}
Note: See TracBrowser for help on using the repository browser.