forked from apache/nuttx-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfstest.h
246 lines (173 loc) · 6.98 KB
/
fstest.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
/****************************************************************************
* apps/testing/fs/basic/include/fstest.h
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __TEST_H
#define __TEST_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <libgen.h>
#include <dirent.h>
#include <sys/stat.h>
#include <syslog.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define TEST_PASS 0
#define TEST_FAIL -1
#define MAX_PATH 300
/* The test files generated during the 'fs-test' are stored in this
* directory
*/
#define FS_TEST_DIR "fs_test_dir"
#define MOUNT_DIR CONFIG_TESTS_TESTSUITES_MOUNT_DIR
#define PATH_SIZE 128
struct fs_testsuites_state_s
{
char filename[PATH_SIZE];
char *ptr;
int fd1;
int fd2;
};
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
unsigned long long cm_get_partition_available_size(void);
int cm_unlink_recursive(FAR char *path);
int test_nuttx_fs_test_group_setup(FAR void **state);
int test_nuttx_fs_test_group_teardown(FAR void **state);
int get_mem_info(struct mallinfo *mem_info);
/* cases/fs_creat_test.c
* ************************************************/
void test_nuttx_fs_creat01(FAR void **state);
/* cases/fs_dup_test.c
* ************************************************/
void test_nuttx_fs_dup01(FAR void **state);
/* cases/fs_dup2_test.c
* ************************************************/
void test_nuttx_fs_dup201(FAR void **state);
/* cases/fs_fcntl_test.c
* ************************************************/
void test_nuttx_fs_fcntl01(FAR void **state);
void test_nuttx_fs_fcntl02(FAR void **state);
void test_nuttx_fs_fcntl03(FAR void **state);
/* cases/fs_fstat_test.c
* ************************************************/
void test_nuttx_fs_fstat01(FAR void **state);
void test_nuttx_fs_fstat02(FAR void **state);
/* cases/fs_fstatfs_test.c
* ************************************************/
void test_nuttx_fs_fstatfs01(FAR void **state);
/* cases/fs_fsync_test.c
* ************************************************/
void test_nuttx_fs_fsync01(FAR void **state);
void test_nuttx_fs_fsync02(FAR void **state);
/* cases/fs_getfilep_test.c
* ************************************************/
void test_nuttx_fs_getfilep01(FAR void **state);
/* cases/fs_mkdir_test.c
* ************************************************/
void test_nuttx_fs_mkdir01(FAR void **state);
/* cases/fs_open_test.c
* ************************************************/
void test_nuttx_fs_open01(FAR void **state);
void test_nuttx_fs_open02(FAR void **state);
/* cases/fs_opendir_test.c
* ************************************************/
void test_nuttx_fs_opendir01(FAR void **state);
void test_nuttx_fs_opendir02(FAR void **state);
/* cases/fs_pread_test.c
* ************************************************/
void test_nuttx_fs_pread01(FAR void **state);
/* cases/fs_pwrite_test.c
* ************************************************/
void test_nuttx_fs_pwrite01(FAR void **state);
/* cases/fs_read_test.c
* ************************************************/
void test_nuttx_fs_read01(FAR void **state);
/* cases/fs_readdir_test.c
* ************************************************/
void test_nuttx_fs_readdir01(FAR void **state);
/* cases/fs_readlink_test.c
* ************************************************/
void test_nuttx_fs_readlink01(FAR void **state);
/* cases/fs_rename_test.c
* ************************************************/
void test_nuttx_fs_rename01(FAR void **state);
void test_nuttx_fs_rename02(FAR void **state);
/* cases/fs_rewinddir_test.c
* ************************************************/
void test_nuttx_fs_rewinddir01(FAR void **state);
/* cases/fs_rmdir_test.c
* ************************************************/
void test_nuttx_fs_rmdir01(FAR void **state);
void test_nuttx_fs_rmdir02(FAR void **state);
void test_nuttx_fs_rmdir03(FAR void **state);
/* cases/fs_seek_test.c
* ************************************************/
void test_nuttx_fs_seek01(FAR void **state);
void test_nuttx_fs_seek02(FAR void **state);
/* cases/fs_stat_test.c
* ************************************************/
void test_nuttx_fs_stat01(FAR void **state);
/* cases/fs_statfs_test.c
* ************************************************/
void test_nuttx_fs_statfs01(FAR void **state);
/* cases/fs_symlink_test.c
* ************************************************/
void test_nuttx_fs_symlink01(FAR void **state);
/* cases/fs_truncate_test.c
* ************************************************/
void test_nuttx_fs_truncate01(FAR void **state);
/* cases/fs_unlink_test.c
* ************************************************/
void test_nuttx_fs_unlink01(FAR void **state);
/* cases/fs_write_test.c
* ************************************************/
void test_nuttx_fs_write01(FAR void **state);
void test_nuttx_fs_write02(FAR void **state);
void test_nuttx_fs_write03(FAR void **state);
/* cases/fs_append_test.c
* ************************************************/
void test_nuttx_fs_append01(FAR void **state);
/* cases/fs_sendfile_test.c
* ************************************************/
void test_nuttx_fs_sendfile01(FAR void **state);
void test_nuttx_fs_sendfile02(FAR void **state);
/* cases/fs_stream_test.c
* ************************************************/
void test_nuttx_fs_stream01(FAR void **state);
void test_nuttx_fs_stream02(FAR void **state);
void test_nuttx_fs_stream03(FAR void **state);
void test_nuttx_fs_stream04(FAR void **state);
/* cases/fs_eventfd_test.c
* ************************************************/
void test_nuttx_fs_eventfd(FAR void **state);
/* fs_poll_test.c
* ************************************************/
void test_nuttx_fs_poll01(FAR void **state);
#endif