source: rtems/testsuites/sptests/spfatal28/testcase.h @ 99de42c

5
Last change on this file since 99de42c was 51b3cbca, checked in by Sebastian Huber <sebastian.huber@…>, on 10/04/18 at 13:23:25

tests: Use rtems_task_exit()

Update #3533.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 * Copyright (c) 2014 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#define FATAL_ERROR_TEST_NAME            "28"
16#define FATAL_ERROR_DESCRIPTION          "delete a task with a semaphore in use"
17#define FATAL_ERROR_EXPECTED_SOURCE      INTERNAL_ERROR_CORE
18#define FATAL_ERROR_EXPECTED_ERROR       INTERNAL_ERROR_RESOURCE_IN_USE
19
20#define CONFIGURE_MAXIMUM_SEMAPHORES 1
21
22void force_error()
23{
24#if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT)
25  rtems_status_code sc;
26  rtems_id id;
27
28  sc = rtems_semaphore_create(
29    rtems_build_name('S', 'E', 'M', 'A'),
30    0,
31    RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY | RTEMS_INHERIT_PRIORITY,
32    0,
33    &id
34  );
35  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
36
37  rtems_task_exit();
38#else
39  _Terminate( INTERNAL_ERROR_CORE, INTERNAL_ERROR_RESOURCE_IN_USE );
40#endif
41}
Note: See TracBrowser for help on using the repository browser.