source: rtems/testsuites/libtests/devfs04/init.c @ 97417bb

5
Last change on this file since 97417bb was 97417bb, checked in by Sebastian Huber <sebastian.huber@…>, on 08/07/18 at 05:09:55

tests: Remove CONFIGURE_MAXIMUM_DRIVERS

This configuration is superfluous in these tests.

  • Property mode set to 100644
File size: 2.5 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#include <rtems/devfs.h>
17#include <errno.h>
18#include <unistd.h>
19#include <sys/types.h>
20#include <sys/stat.h>
21#include <fcntl.h>
22#include "test_driver.h"
23#include <rtems/devnull.h>
24
25const char rtems_test_name[] = "DEVFS 4";
26
27/* forward declarations to avoid warnings */
28rtems_task Init(rtems_task_argument argument);
29
30rtems_task Init(
31  rtems_task_argument argument
32)
33{
34  int status;
35  int fdr = 0, fdw = 0;
36  char buf[10];
37
38  TEST_BEGIN();
39
40  puts( "Init - attempt to open the /dev/test WR mode -- OK" );
41  fdw = open( "/dev/test", O_WRONLY );
42  rtems_test_assert( fdw != -1 );
43 
44  puts( "Init - attempt to write to /dev/test -- OK" );
45  status = write( fdw, "data", 5 );
46  rtems_test_assert( status == 5 );
47
48  puts( "Init - attempt to write to /dev/test - expect ENOSYS" );
49  status = write( fdw, "data", 10 );
50  rtems_test_assert( status == -1 );
51  rtems_test_assert( errno == ENOSYS );
52
53  puts( "Init - attempt to open the /dev/test RD mode -- OK" );
54  fdr = open( "/dev/test", O_RDONLY );
55  rtems_test_assert( fdr != -1 );
56
57  puts( "Init - attempt to read from /dev/test -- OK" );
58  status = read( fdr, buf, 5 );
59  rtems_test_assert( status == 0 );
60
61  puts( "Init - attempt to read from /dev/test - expect ENOSYS" );
62  status = read( fdr, buf, 10 );
63  rtems_test_assert( status == -1 );
64  rtems_test_assert( errno == ENOSYS );
65
66  puts( "Init - attempt ioctl on the device - expect ENOSYS" );
67  status = ioctl( fdr, -1 );
68  rtems_test_assert( status == -1 );
69  rtems_test_assert( errno == ENOSYS );
70
71  puts( "Init - mknod(/dev/null)-- OK" );
72  status = mknod( "/dev/null", 0777 | S_IFCHR, 0LL );
73  rtems_test_assert( status == 0 );
74
75  TEST_END();
76  rtems_test_exit(0);
77}
78
79/* configuration information */
80
81#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
82#define CONFIGURE_APPLICATION_EXTRA_DRIVERS TEST_DRIVER_TABLE_ENTRY
83
84#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 2
85
86#define CONFIGURE_MAXIMUM_TASKS             1
87#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
88
89#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
90
91/* Make sure that we have enough devices for all BSPs */
92#define CONFIGURE_MAXIMUM_DEVICES 64
93
94#define CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM
95
96#define CONFIGURE_INIT
97#include <rtems/confdefs.h>
98/* end of file */
Note: See TracBrowser for help on using the repository browser.