source: rtems/testsuites/sptests/spfifo01/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.5 KB
Line 
1/*
2 *  COPYRIGHT (c) 2010
3 *  Bharath Suri<bharath.s.jois@gmail.com>.
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 <sys/stat.h>
15#include <stdio.h>
16#include <fcntl.h>
17#include <errno.h>
18#include <unistd.h>
19
20#include "tmacros.h"
21
22const char rtems_test_name[] = "SPFIFO 1";
23
24/* forward declarations to avoid warnings */
25rtems_task Init(rtems_task_argument argument);
26
27#define FIFO_PATH "/fifo01"
28
29static void test_main(void)
30{
31  mode_t rwx = S_IRWXU | S_IRWXG | S_IRWXO;
32  int status;
33
34  TEST_BEGIN();
35
36  puts(
37    "\nConfiguration: Pipes disabled.\n"
38    "Creating named fifo '" FIFO_PATH "'.\n"
39    "Must result in failure since pipes are disabled in the configuration."
40  );
41
42  errno = 0;
43  status = mkfifo(FIFO_PATH, rwx);
44  rtems_test_assert(status == -1);
45  rtems_test_assert(errno == ENOSYS);
46
47  errno = 0;
48  status = mknod(FIFO_PATH, S_IFIFO | rwx, 0);
49  rtems_test_assert(status == -1);
50  rtems_test_assert(errno == ENOSYS);
51
52  TEST_END();
53}
54
55rtems_task Init(rtems_task_argument not_used)
56{
57  test_main();
58  rtems_test_exit(0);
59}
60
61#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
62#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
63
64#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4
65
66#define CONFIGURE_MAXIMUM_TASKS 1
67
68#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
69
70#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
71
72#define CONFIGURE_INIT
73
74#include <rtems/confdefs.h>
Note: See TracBrowser for help on using the repository browser.