source: rtems/testsuites/samples/base_mp/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 <stdio.h>
19
20#include "tmacros.h"
21
22/* forward declarations to avoid warnings */
23rtems_task Init(rtems_task_argument argument);
24
25const char rtems_test_name[] = "SAMPLE MULTIPROCESSOR APPLICATION";
26
27rtems_task Init(
28  rtems_task_argument argument
29)
30{
31  rtems_name        task_name;
32  rtems_id          tid;
33  rtems_status_code status;
34
35  TEST_BEGIN();
36  printf( "Creating and starting an application task\n" );
37  task_name = rtems_build_name( 'T', 'A', '1', ' ' );
38  status = rtems_task_create( task_name, 1, RTEMS_MINIMUM_STACK_SIZE,
39             RTEMS_INTERRUPT_LEVEL(0), RTEMS_DEFAULT_ATTRIBUTES, &tid );
40  rtems_test_assert(status == RTEMS_SUCCESSFUL);
41
42  status = rtems_task_start(
43    tid,
44    Application_task,
45    Multiprocessing_configuration.node
46  );
47  rtems_test_assert(status == RTEMS_SUCCESSFUL);
48
49  rtems_task_delete( RTEMS_SELF );
50}
Note: See TracBrowser for help on using the repository browser.