source: rtems/testsuites/sptests/spmountmgr01/init.c @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 3.5 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2010.
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.com/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 <errno.h>
17#include <rtems/libio_.h>
18#include <rtems/libcsupport.h>
19
20int fs_mount( rtems_filesystem_mount_table_entry_t *mt_entry,
21              const void                           *data )
22{
23  return 0;
24}
25
26rtems_task Init(
27  rtems_task_argument argument
28)
29{
30  int status = 0;
31  void *alloc_ptr = (void *)0;
32 
33  puts( "\n\n*** TEST MOUNT MANAGER ROUTINE - 01 ***" );
34
35  puts( "Init - allocating most of heap -- OK" );
36  alloc_ptr = malloc( malloc_free_space() - 4 );
37  rtems_test_assert( alloc_ptr != NULL );
38
39  puts( "Init - attempt to register filesystem fs - expect ENOMEM" );
40  status = rtems_filesystem_register( "fs", fs_mount );
41  rtems_test_assert( status == -1 );
42  rtems_test_assert( errno == ENOMEM );
43
44  puts( "Init - freeing allocated memory -- OK" );
45  free( alloc_ptr );
46
47  puts( "Init - register filesystem fs -- OK" );
48  status = rtems_filesystem_register( "fs", fs_mount );
49  rtems_test_assert( status == 0 );
50
51  puts( "Init - attempt to make target(NULL) and mount - expect EINVAL" );
52  status = mount_and_make_target_path(
53             NULL,
54             NULL,
55             "fs",
56             0,
57             NULL );
58  rtems_test_assert( status == -1 );
59  rtems_test_assert( errno == EINVAL );
60
61  puts( "Init - attempt to make target and mount - expect EINVAL" );
62  status = mount_and_make_target_path(
63             NULL,
64             "/tmp",
65             "fs",
66             2,
67             NULL );
68  rtems_test_assert( status == -1 );
69  rtems_test_assert( errno == EINVAL );
70
71             
72  puts( "Init - register filesystem fs - expect EINVAL" );
73  status = rtems_filesystem_register( "fs", fs_mount );
74  rtems_test_assert( status == -1 );
75  rtems_test_assert( errno == EINVAL );
76
77  puts( "Init - register filesystem bfs -- OK" );
78  status = rtems_filesystem_register( "bfs", fs_mount );
79  rtems_test_assert( status == 0 );
80
81  puts( "Init - register filesystem bfs - expect EINVAL" );
82  status = rtems_filesystem_register( "bfs", fs_mount );
83  rtems_test_assert( status == -1 );
84  rtems_test_assert( errno == EINVAL );
85 
86  puts( "Init - attempt to unregister with bad args - expect EINVAL" );
87  status = rtems_filesystem_unregister( NULL );
88  rtems_test_assert( status == -1 );
89  rtems_test_assert( errno == EINVAL );
90
91  puts( "Init - attempt to unregister fs -- OK" );
92  status = rtems_filesystem_unregister( "fs" );
93  rtems_test_assert( status == 0 );
94 
95  puts( "Init - attempt to unregister fs again - expect ENOENT" );
96  status = rtems_filesystem_unregister( "fs" );
97  rtems_test_assert( status == -1 );
98  rtems_test_assert( errno == ENOENT );
99
100  puts( "Init - attempt to unregister bfs -- OK" );
101  status = rtems_filesystem_unregister( "bfs" );
102  rtems_test_assert( status == 0 );
103 
104  puts( "Init - attempt to unregister bfs again - expect ENOENT" );
105  status = rtems_filesystem_unregister( "bfs" );
106  rtems_test_assert( status == -1 );
107  rtems_test_assert( errno == ENOENT );
108
109  puts( "*** END OF TEST MOUNT MANAGER ROUTINE - 01 ***" );
110  rtems_test_exit(0);
111}
112
113/* configuration information */
114
115#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
116#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
117
118#define CONFIGURE_MAXIMUM_TASKS             1
119#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
120
121#define CONFIGURE_INIT
122
123#include <rtems/confdefs.h>
124/* end of file */
Note: See TracBrowser for help on using the repository browser.