1 /*
2 * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
3 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without modification,
6 * are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice, this list of
9 * conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 * of conditions and the following disclaimer in the documentation and/or other materials
13 * provided with the distribution.
14 *
15 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
16 * to endorse or promote products derived from this software without specific prior written
17 * permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31 #include <climits>
32 #include <gtest/gtest.h>
33
34 #include "It_test_IO.h"
35
36 char *g_ioTestPath = "/storage";
37
38 using namespace testing::ext;
39 namespace OHOS {
40 class IoTest : public testing::Test {
41 public:
SetUpTestCase(void)42 static void SetUpTestCase(void) {}
TearDownTestCase(void)43 static void TearDownTestCase(void) {}
44 };
45
46 #if defined(LOSCFG_USER_TEST_SMOKE)
47 /* *
48 * @tc.name: IT_TEST_IO_005
49 * @tc.desc: function for IoTest
50 * @tc.type: FUNC
51 */
HWTEST_F(IoTest, ItTestIo005, TestSize.Level0)52 HWTEST_F(IoTest, ItTestIo005, TestSize.Level0)
53 {
54 ItTestIo005();
55 }
56
57 #ifdef LOSCFG_USER_TEST_FS_JFFS
58 /* *
59 * @tc.name: IT_TEST_IO_008
60 * @tc.desc: function for IoTest
61 * @tc.type: FUNC
62 */
HWTEST_F(IoTest, ItTestIo008, TestSize.Level0)63 HWTEST_F(IoTest, ItTestIo008, TestSize.Level0)
64 {
65 ItTestIo008();
66 }
67 #endif
68
69
70 /* *
71 * @tc.name: IT_TEST_IO_010
72 * @tc.desc: function for IoTest
73 * @tc.type: FUNC
74 */
HWTEST_F(IoTest, ItTestIo010, TestSize.Level0)75 HWTEST_F(IoTest, ItTestIo010, TestSize.Level0)
76 {
77 ItTestIo010();
78 }
79
80 /* *
81 * @tc.name: IT_TEST_IO_013
82 * @tc.desc: function for IoTest
83 * @tc.type: FUNC
84 */
HWTEST_F(IoTest, ItTestIo013, TestSize.Level0)85 HWTEST_F(IoTest, ItTestIo013, TestSize.Level0)
86 {
87 ItTestIo013();
88 }
89 #endif
90
91 #if defined(LOSCFG_USER_TEST_FULL)
92 /* *
93 * @tc.name: IO_TEST_PSELECT_001
94 * @tc.desc: function for IoTest
95 * @tc.type: FUNC
96 */
HWTEST_F(IoTest, IO_TEST_PSELECT_001, TestSize.Level0)97 HWTEST_F(IoTest, IO_TEST_PSELECT_001, TestSize.Level0)
98 {
99 IO_TEST_PSELECT_001();
100 }
101
102 /* *
103 * @tc.name: IO_TEST_PSELECT_002
104 * @tc.desc: function for IoTest
105 * @tc.type: FUNC
106 */
HWTEST_F(IoTest, IO_TEST_PSELECT_002, TestSize.Level0)107 HWTEST_F(IoTest, IO_TEST_PSELECT_002, TestSize.Level0)
108 {
109 IO_TEST_PSELECT_002();
110 }
111
112 /* *
113 * @tc.name: IO_TEST_PPOLL_001
114 * @tc.desc: function for IoTest
115 * @tc.type: FUNC
116 */
HWTEST_F(IoTest, IO_TEST_PPOLL_001, TestSize.Level0)117 HWTEST_F(IoTest, IO_TEST_PPOLL_001, TestSize.Level0)
118 {
119 IO_TEST_PPOLL_001();
120 }
121
122 /* *
123 * @tc.name: IO_TEST_PPOLL_002
124 * @tc.desc: function for IoTest
125 * @tc.type: FUNC
126 */
HWTEST_F(IoTest, IO_TEST_PPOLL_002, TestSize.Level0)127 HWTEST_F(IoTest, IO_TEST_PPOLL_002, TestSize.Level0)
128 {
129 IO_TEST_PPOLL_002();
130 }
131
132 /* *
133 * @tc.name: IO_TEST_PPOLL_003
134 * @tc.desc: function for IoTest
135 * @tc.type: FUNC
136 */
HWTEST_F(IoTest, IO_TEST_PPOLL_003, TestSize.Level0)137 HWTEST_F(IoTest, IO_TEST_PPOLL_003, TestSize.Level0)
138 {
139 IO_TEST_PPOLL_003();
140 }
141
142 /* *
143 * @tc.name: IO_TEST_EPOLL_001
144 * @tc.desc: function for IoTest
145 * @tc.type: FUNC
146 */
147
HWTEST_F(IoTest, IO_TEST_EPOLL_001, TestSize.Level0)148 HWTEST_F(IoTest, IO_TEST_EPOLL_001, TestSize.Level0)
149 {
150 IO_TEST_EPOLL_001();
151 }
152
153 /* *
154 * @tc.name: IO_TEST_EPOLL_002
155 * @tc.desc: function for IoTest
156 * @tc.type: FUNC
157 */
HWTEST_F(IoTest, IO_TEST_EPOLL_002, TestSize.Level0)158 HWTEST_F(IoTest, IO_TEST_EPOLL_002, TestSize.Level0)
159 {
160 IO_TEST_EPOLL_002();
161 }
162
163 /* *
164 * @tc.name: IT_STDLIB_POLL_002
165 * @tc.desc: function for IoTest
166 * @tc.type: FUNC
167 */
HWTEST_F(IoTest, ItStdlibPoll002, TestSize.Level0)168 HWTEST_F(IoTest, ItStdlibPoll002, TestSize.Level0)
169 {
170 ItStdlibPoll002();
171 }
172
173 /* *
174 * @tc.name: IT_STDLIB_POLL_003
175 * @tc.desc: function for IoTest
176 * @tc.type: FUNC
177 */
HWTEST_F(IoTest, ItStdlibPoll003, TestSize.Level0)178 HWTEST_F(IoTest, ItStdlibPoll003, TestSize.Level0)
179 {
180 ItStdlibPoll003();
181 }
182
183 /* *
184 * @tc.name: IT_STDIO_PUTWC_001
185 * @tc.desc: function for IoTest
186 * @tc.type: FUNC
187 */
HWTEST_F(IoTest, ItStdioPutwc001, TestSize.Level0)188 HWTEST_F(IoTest, ItStdioPutwc001, TestSize.Level0)
189 {
190 ItStdioPutwc001();
191 }
192
193 /* *
194 * @tc.name: IT_STDIO_READV_001
195 * @tc.desc: function for IoTest
196 * @tc.type: FUNC
197 */
HWTEST_F(IoTest, ItStdioReadv001, TestSize.Level0)198 HWTEST_F(IoTest, ItStdioReadv001, TestSize.Level0)
199 {
200 ItStdioReadv001();
201 }
202
203 /* *
204 * @tc.name: IT_STDIO_RINDEX_001
205 * @tc.desc: function for IoTest
206 * @tc.type: FUNC
207 */
HWTEST_F(IoTest, ItStdioRindex001, TestSize.Level0)208 HWTEST_F(IoTest, ItStdioRindex001, TestSize.Level0)
209 {
210 ItStdioRindex001();
211 }
212
213 /* *
214 * @tc.name: IT_STDIO_SETLOGMASK_001
215 * @tc.desc: function for IoTest
216 * @tc.type: FUNC
217 */
HWTEST_F(IoTest, ItStdioSetlogmask001, TestSize.Level0)218 HWTEST_F(IoTest, ItStdioSetlogmask001, TestSize.Level0)
219 {
220 ItStdioSetlogmask001();
221 }
222
223 /* *
224 * @tc.name: IT_STDLIB_GCVT_001
225 * @tc.desc: function for IoTest
226 * @tc.type: FUNC
227 */
HWTEST_F(IoTest, ItStdlibGcvt001, TestSize.Level0)228 HWTEST_F(IoTest, ItStdlibGcvt001, TestSize.Level0)
229 {
230 ItStdlibGcvt001();
231 }
232
233 /* *
234 * @tc.name: IT_LOCALE_LOCALECONV_001
235 * @tc.desc: function for IoTest
236 * @tc.type: FUNC
237 */
HWTEST_F(IoTest, ItLocaleLocaleconv001, TestSize.Level0)238 HWTEST_F(IoTest, ItLocaleLocaleconv001, TestSize.Level0)
239 {
240 ItLocaleLocaleconv001();
241 }
242
243 /* *
244 * @tc.name: IT_STDIO_FPUTWS_001
245 * @tc.desc: function for IoTest
246 * @tc.type: FUNC
247 */
HWTEST_F(IoTest, ItStdioFputws001, TestSize.Level0)248 HWTEST_F(IoTest, ItStdioFputws001, TestSize.Level0)
249 {
250 ItStdioFputws001();
251 }
252
253 /* *
254 * @tc.name: IT_STDIO_FWPRINTF_001
255 * @tc.desc: function for IoTest
256 * @tc.type: FUNC
257 */
HWTEST_F(IoTest, ItStdioFwprintf001, TestSize.Level0)258 HWTEST_F(IoTest, ItStdioFwprintf001, TestSize.Level0)
259 {
260 ItStdioFwprintf001();
261 }
262
263 /* *
264 * @tc.name: IT_STDIO_GETC_UNLOCKED_001
265 * @tc.desc: function for IoTest
266 * @tc.type: FUNC
267 */
HWTEST_F(IoTest, ItStdioGetcUnlocked001, TestSize.Level0)268 HWTEST_F(IoTest, ItStdioGetcUnlocked001, TestSize.Level0)
269 {
270 ItStdioGetcUnlocked001();
271 }
272
273 /* *
274 * @tc.name: IT_STDIO_MBLEN_001
275 * @tc.desc: function for IoTest
276 * @tc.type: FUNC
277 */
HWTEST_F(IoTest, ItStdioMblen001, TestSize.Level0)278 HWTEST_F(IoTest, ItStdioMblen001, TestSize.Level0)
279 {
280 ItStdioMblen001();
281 }
282
283 /* *
284 * @tc.name: IT_STDIO_MBRLEN_001
285 * @tc.desc: function for IoTest
286 * @tc.type: FUNC
287 */
HWTEST_F(IoTest, ItStdioMbrlen001, TestSize.Level0)288 HWTEST_F(IoTest, ItStdioMbrlen001, TestSize.Level0)
289 {
290 ItStdioMbrlen001();
291 }
292
293 /* *
294 * @tc.name: IT_STDIO_HASMNTOPT_001
295 * @tc.desc: function for IoTest-normal testcase
296 * @tc.type: FUNC
297 */
HWTEST_F(IoTest, IT_STDIO_HASMNTOPT_001, TestSize.Level0)298 HWTEST_F(IoTest, IT_STDIO_HASMNTOPT_001, TestSize.Level0)
299 {
300 IT_STDIO_HASMNTOPT_001();
301 }
302
303 /* *
304 * @tc.name: IO_TEST_DUPLOCALE_001
305 * @tc.desc: function for IoTest-dup the locale global pointer
306 * @tc.type: FUNC
307 */
HWTEST_F(IoTest, IO_TEST_DUPLOCALE_001, TestSize.Level0)308 HWTEST_F(IoTest, IO_TEST_DUPLOCALE_001, TestSize.Level0)
309 {
310 IO_TEST_DUPLOCALE_001();
311 }
312
313 /* *
314 * @tc.name: IO_TEST_NL_LANGINFO_001
315 * @tc.desc: function for IoTest-normal testcase
316 * @tc.type: FUNC
317 */
HWTEST_F(IoTest, IO_TEST_NL_LANGINFO_001, TestSize.Level0)318 HWTEST_F(IoTest, IO_TEST_NL_LANGINFO_001, TestSize.Level0)
319 {
320 IO_TEST_NL_LANGINFO_001();
321 }
322
323 /* *
324 * @tc.name: IO_TEST_STRCASECMP_L_001
325 * @tc.desc: function for IoTest-normal testcase
326 * @tc.type: FUNC
327 */
HWTEST_F(IoTest, IO_TEST_STRCASECMP_L_001, TestSize.Level0)328 HWTEST_F(IoTest, IO_TEST_STRCASECMP_L_001, TestSize.Level0)
329 {
330 IO_TEST_STRCASECMP_L_001();
331 }
332
333 /* *
334 * @tc.name: IO_TEST_STRCASECMP_L_002
335 * @tc.desc: function for IoTest-normal testcase
336 * @tc.type: FUNC
337 */
HWTEST_F(IoTest, IO_TEST_STRCASECMP_L_002, TestSize.Level0)338 HWTEST_F(IoTest, IO_TEST_STRCASECMP_L_002, TestSize.Level0)
339 {
340 IO_TEST_STRCASECMP_L_002();
341 }
342
343 /* *
344 * @tc.name: IO_TEST_STRNCASECMP_L_001
345 * @tc.desc: function for IoTest-normal testcase
346 * @tc.type: FUNC
347 */
HWTEST_F(IoTest, IO_TEST_STRNCASECMP_L_001, TestSize.Level0)348 HWTEST_F(IoTest, IO_TEST_STRNCASECMP_L_001, TestSize.Level0)
349 {
350 IO_TEST_STRNCASECMP_L_001();
351 }
352
353 /* *
354 * @tc.name: IO_TEST_STRNCASECMP_L_002
355 * @tc.desc: function for IoTest-normal testcase
356 * @tc.type: FUNC
357 */
HWTEST_F(IoTest, IO_TEST_STRNCASECMP_L_002, TestSize.Level0)358 HWTEST_F(IoTest, IO_TEST_STRNCASECMP_L_002, TestSize.Level0)
359 {
360 IO_TEST_STRNCASECMP_L_002();
361 }
362
363 /* *
364 * @tc.name: IO_TEST_NL_LANGINFO_l_001
365 * @tc.desc: function for IoTest-query language and locale information
366 * @tc.type: FUNC
367 */
HWTEST_F(IoTest, IO_TEST_NL_LANGINFO_l_001, TestSize.Level0)368 HWTEST_F(IoTest, IO_TEST_NL_LANGINFO_l_001, TestSize.Level0)
369 {
370 IO_TEST_NL_LANGINFO_l_001();
371 }
372
373 /* *
374 * @tc.name: IO_TEST_DNGETTEXT_001
375 * @tc.desc: function for IoTest-print the translated string1 or string2
376 * @tc.type: FUNC
377 */
HWTEST_F(IoTest, IO_TEST_DNGETTEXT_001, TestSize.Level0)378 HWTEST_F(IoTest, IO_TEST_DNGETTEXT_001, TestSize.Level0)
379 {
380 IO_TEST_DNGETTEXT_001();
381 }
382
383 /* *
384 * @tc.name: IO_TEST_DNGETTEXT_002
385 * @tc.desc: function for IoTest-innormal testcases
386 * @tc.type: FUNC
387 */
HWTEST_F(IoTest, IO_TEST_DNGETTEXT_002, TestSize.Level0)388 HWTEST_F(IoTest, IO_TEST_DNGETTEXT_002, TestSize.Level0)
389 {
390 IO_TEST_DNGETTEXT_002();
391 }
392
393 /* *
394 * @tc.name: IO_TEST_DCNGETTEXT_001
395 * @tc.desc: function for IoTest-print the translated string1 or string2 with locale parameter
396 * @tc.type: FUNC
397 */
HWTEST_F(IoTest, IO_TEST_DCNGETTEXT_001, TestSize.Level0)398 HWTEST_F(IoTest, IO_TEST_DCNGETTEXT_001, TestSize.Level0)
399 {
400 IO_TEST_DCNGETTEXT_001();
401 }
402
403 /* *
404 * @tc.name: IO_TEST_DCNGETTEXT_002
405 * @tc.desc: function for IoTest-innormal testcases
406 * @tc.type: FUNC
407 */
HWTEST_F(IoTest, IO_TEST_DCNGETTEXT_002, TestSize.Level0)408 HWTEST_F(IoTest, IO_TEST_DCNGETTEXT_002, TestSize.Level0)
409 {
410 IO_TEST_DCNGETTEXT_002();
411 }
412 /* *
413 * @tc.name: IO_TEST_DCGETTEXT_001
414 * @tc.desc: function for IoTest-print the translated string with locale parameter
415 * @tc.type: FUNC
416 */
HWTEST_F(IoTest, IO_TEST_DCGETTEXT_001, TestSize.Level0)417 HWTEST_F(IoTest, IO_TEST_DCGETTEXT_001, TestSize.Level0)
418 {
419 IO_TEST_DCGETTEXT_001();
420 }
421
422 /* *
423 * @tc.name: IO_TEST_DCGETTEXT_002
424 * @tc.desc: function for IoTest-innormal testcases
425 * @tc.type: FUNC
426 */
HWTEST_F(IoTest, IO_TEST_DCGETTEXT_002, TestSize.Level0)427 HWTEST_F(IoTest, IO_TEST_DCGETTEXT_002, TestSize.Level0)
428 {
429 IO_TEST_DCGETTEXT_002();
430 }
431
432 /* *
433 * @tc.name: IO_TEST_GETTEXT_001
434 * @tc.desc: function for IoTest-normal testcases
435 * @tc.type: FUNC
436 */
HWTEST_F(IoTest, IO_TEST_GETTEXT_001, TestSize.Level0)437 HWTEST_F(IoTest, IO_TEST_GETTEXT_001, TestSize.Level0)
438 {
439 IO_TEST_GETTEXT_001();
440 }
441
442 /* *
443 * @tc.name: IO_TEST_LOCALE_001
444 * @tc.desc: function for IoTest-normal testcases
445 * @tc.type: FUNC
446 */
HWTEST_F(IoTest, IO_TEST_LOCALE_001, TestSize.Level0)447 HWTEST_F(IoTest, IO_TEST_LOCALE_001, TestSize.Level0)
448 {
449 IO_TEST_LOCALE_001();
450 }
451
452 /* *
453 * @tc.name: IO_TEST_LOCALE_002
454 * @tc.desc: function for IoTest-innormal testcases
455 * @tc.type: FUNC
456 */
HWTEST_F(IoTest, IO_TEST_LOCALE_002, TestSize.Level0)457 HWTEST_F(IoTest, IO_TEST_LOCALE_002, TestSize.Level0)
458 {
459 IO_TEST_LOCALE_002();
460 }
461
462 /* *
463 * @tc.name: IO_TEST_STRFMON_L_001
464 * @tc.desc: function for IoTest-normal testcases
465 * @tc.type: FUNC
466 */
HWTEST_F(IoTest, IO_TEST_STRFMON_L_001, TestSize.Level0)467 HWTEST_F(IoTest, IO_TEST_STRFMON_L_001, TestSize.Level0)
468 {
469 IO_TEST_STRFMON_L_001();
470 }
471
472 /* *
473 * @tc.name: IO_TEST_STRFMON_L_002
474 * @tc.desc: function for IoTest-innormal testcases
475 * @tc.type: FUNC
476 */
HWTEST_F(IoTest, IO_TEST_STRFMON_L_002, TestSize.Level0)477 HWTEST_F(IoTest, IO_TEST_STRFMON_L_002, TestSize.Level0)
478 {
479 IO_TEST_STRFMON_L_002();
480 }
481
482 /* *
483 * @tc.name: IO_TEST_NGETTEXT_001
484 * @tc.desc: function for IoTest-normal testcases
485 * @tc.type: FUNC
486 */
HWTEST_F(IoTest, IO_TEST_NGETTEXT_001, TestSize.Level0)487 HWTEST_F(IoTest, IO_TEST_NGETTEXT_001, TestSize.Level0)
488 {
489 IO_TEST_NGETTEXT_001();
490 }
491
492 #endif
493 } // namespace OHOS
494