/test/xts/acts/kernel_lite/fs_posix/src/ |
H A D | FsFcntlTest.cpp | 46 int fd = 0;
in HWTEST_F() local 47 EXPECT_NE((fd = open(FILE0, O_CREAT | O_RDWR, 0777)), -1) << "> open faild errno = " << errno;
in HWTEST_F() 48 WriteCloseTest(fd);
in HWTEST_F() 52 EXPECT_NE((fd = open(FILE0, O_RDONLY, 0777)), -1) << "> open faild errno = " << errno;
in HWTEST_F() 54 EXPECT_EQ((fdNew = fcntl(fd, F_DUPFD)), -1) << "> fcntl errno = " << errno;
in HWTEST_F() 58 EXPECT_NE(close(fd), -1) << "> close errno = " << errno;
in HWTEST_F() 69 int fd = 0;
in HWTEST_F() local 70 EXPECT_NE((fd = open(FILE0, O_CREAT | O_RDWR, 0777)), -1) << "> open faild errno = " << errno;
in HWTEST_F() 71 WriteCloseTest(fd);
in HWTEST_F() 74 EXPECT_NE((fd in HWTEST_F() 90 int fd = 0; HWTEST_F() local 117 int fd = 0; HWTEST_F() local 149 int fd = 0; HWTEST_F() local 180 int fd = 0; HWTEST_F() local 216 int fd = open(FILE0, O_RDWR | O_CREAT | O_EXCL, 0777); HWTEST_F() local 262 int fd = open(FILE0, O_RDWR | O_CREAT | O_EXCL, 0777); HWTEST_F() local 297 int fd = open(FILE0, O_RDWR | O_CREAT | O_EXCL, 0777); HWTEST_F() local 309 int fd = 0; HWTEST_F() local 327 int fd = 0; HWTEST_F() local 344 int fd = 0; HWTEST_F() local 359 int fd = 0; HWTEST_F() local [all...] |
H A D | FsUnistdTest.cpp | 43 int fd = 0; in HWTEST_F() local 44 fd = creat(FILE0, 0777); in HWTEST_F() 45 EXPECT_NE(fd, -1) << "> creat faild errno = " << errno; in HWTEST_F() 46 EXPECT_NE(close(fd), -1) << "> close errno = " << errno; in HWTEST_F() 69 int fd = 0; in HWTEST_F() local 70 fd = creat(FILE0, 0777); in HWTEST_F() 71 EXPECT_NE(fd, -1) << "> creat faild errno = " << errno; in HWTEST_F() 72 EXPECT_NE(close(fd), -1) << "> close errno = " << errno; in HWTEST_F() 85 int fd = 0; in HWTEST_F() local 86 fd in HWTEST_F() 101 int fd = 0; HWTEST_F() local 168 int fd = 0; HWTEST_F() local 187 int fd = 0; HWTEST_F() local 210 int fd = 0; HWTEST_F() local 259 int fd = 0; HWTEST_F() local 281 int fd = 0; HWTEST_F() local 441 int fd = open(FILE0, O_CREAT | O_RDWR, 0777); HWTEST_F() local 487 int fd = open(FILE0, O_CREAT | O_RDWR, 0777); HWTEST_F() local [all...] |
/test/xts/acts/kernel_lite/ipc_posix/pipe_fifo/ |
H A D | PipeTest.cpp | 41 int fd[2];
in HWTEST_F() local 45 ret = pipe(fd);
in HWTEST_F() 51 close(fd[1]);
in HWTEST_F() 52 if (read(fd[0], readBuffer, 20) == -1) {
in HWTEST_F() 53 close(fd[0]);
in HWTEST_F() 57 close(fd[0]);
in HWTEST_F() 60 close(fd[0]);
in HWTEST_F() 65 close(fd[0]);
in HWTEST_F() 66 ret = write(fd[1], "hello world", sizeof("hello world"));
in HWTEST_F() 68 close(fd[ in HWTEST_F() 81 int fd[2]; HWTEST_F() local 122 int fd[2]; HWTEST_F() local 185 int fd[2]; HWTEST_F() local 240 int fd[2]; HWTEST_F() local [all...] |
H A D | FifoTest.cpp | 51 int fd;
in HWTEST_F() local 58 fd = open(FIFO_PATH, O_WRONLY, S_IRUSR|S_IWUSR);
in HWTEST_F() 59 write(fd, sentence, sizeof(sentence));
in HWTEST_F() 61 close(fd);
in HWTEST_F() 67 fd = open(FIFO_PATH, O_RDONLY, S_IRUSR|S_IWUSR);
in HWTEST_F() 68 EXPECT_NE(fd, -1) << "> open faild errno = " << errno;
in HWTEST_F() 69 EXPECT_NE(read(fd, buffer, sizeof(buffer)), -1) << "> read errno = " << errno;
in HWTEST_F() 72 close(fd);
in HWTEST_F() 108 int fd = -1;
in HWTEST_F() local 124 fd in HWTEST_F() 172 int fd = -1; HWTEST_F() local [all...] |
/test/xts/hats/kernel/syscalls/fileio/openat/ |
H A D | OpenatApiTest.cpp | 72 int fd = openat(dirFd, TEST_FILE, O_WRONLY | O_CREAT, 0644); in HWTEST_F() local 73 EXPECT_TRUE(fd >= 0); in HWTEST_F() 74 close(fd); in HWTEST_F() 76 fd = openat(dirFd, TEST_FILE, O_RDONLY); in HWTEST_F() 77 EXPECT_TRUE(fd >= 0); in HWTEST_F() 80 ssize_t bytesWritten = write(fd, "A", 1); in HWTEST_F() 83 close(fd); in HWTEST_F() 101 int fd = -1; in HWTEST_F() local 105 fd = openat(dirFd, TEST_FILE, O_RDWR | O_CREAT, 0644); in HWTEST_F() 106 EXPECT_TRUE(fd > in HWTEST_F() 130 int fd = -1; HWTEST_F() local 174 int fd = -1; HWTEST_F() local 196 int fd; HWTEST_F() local 231 int fd = -1; HWTEST_F() local 259 int fd = -1; HWTEST_F() local 293 int fd = -1; HWTEST_F() local 321 int fd = -1; HWTEST_F() local 355 int fd = openat(dirFd, TEST_FILE, O_RDWR | O_CREAT, 0644); HWTEST_F() local 403 int fd = openat(dirFd, TEST_FILE, O_RDWR | O_CLOEXEC | O_CREAT, 0755); HWTEST_F() local [all...] |
/test/xts/acts/commonlibrary_lite/file_hal/src/ |
H A D | utils_file_func_test.c | 67 int fd = UtilsFileOpen(fileName, O_RDONLY_FS | O_CREAT_FS, 0); variable 68 TEST_ASSERT_GREATER_THAN_INT(0, fd); 69 int ret = UtilsFileClose(fd); 82 int fd = UtilsFileOpen(fileName, O_WRONLY_FS | O_CREAT_FS, 0); variable 83 TEST_ASSERT_GREATER_THAN_INT(0, fd); 84 int ret = UtilsFileClose(fd); 97 int fd = UtilsFileOpen(fileName, O_RDWR_FS | O_CREAT_FS, 0); variable 98 TEST_ASSERT_GREATER_THAN_INT(0, fd); 99 int ret = UtilsFileClose(fd); 114 int fd variable 131 int fd = UtilsFileOpen(fileName, O_WRONLY_FS, 0); global() variable 148 int fd = UtilsFileOpen(fileName, O_RDWR_FS, 0); global() variable 165 int fd = UtilsFileOpen(fileName, O_RDWR_FS | O_TRUNC_FS, 0); global() variable 182 int fd = UtilsFileOpen(fileName, O_RDWR_FS | O_APPEND_FS, 0); global() variable 197 int fd = UtilsFileOpen(fileName, O_RDONLY_FS | O_CREAT_FS | O_EXCL_FS, 0); global() variable 216 int fd = UtilsFileOpen(fileName, O_WRONLY_FS | O_CREAT_FS | O_EXCL_FS, 0); global() variable 235 int fd = UtilsFileOpen(fileName, O_RDWR_FS | O_CREAT_FS | O_EXCL_FS, 0); global() variable 254 int fd = UtilsFileOpen(fileName, O_RDWR_FS | O_CREAT_FS | O_EXCL_FS | O_TRUNC_FS, 0); global() variable 273 int fd = UtilsFileOpen(fileName, O_RDWR_FS | O_CREAT_FS | O_EXCL_FS | O_APPEND_FS, 0); global() variable 294 int fd = UtilsFileOpen(fileName, O_RDWR_FS, 0); global() variable 297 UtilsFileClose(fd); global() variable 312 int fd = UtilsFileOpen(fileName, O_RDWR_FS | O_APPEND_FS, 0); global() variable 315 UtilsFileClose(fd); global() variable 331 int fd = UtilsFileOpen(fileName, O_RDONLY_FS | O_CREAT_FS, 0); global() variable 333 UtilsFileClose(fd); global() variable 345 int fd = UtilsFileOpen(fileName, O_RDONLY_FS, 0); global() variable 356 int fd = 1073; global() variable 368 int fd = 1073; global() variable 382 int fd = UtilsFileOpen(fileName, O_RDONLY_FS | O_CREAT_FS, 0); global() variable 397 int fd = UtilsFileOpen(fileName, O_RDWR_FS, 0); global() variable 400 UtilsFileClose(fd); global() variable 415 int fd = UtilsFileOpen(fileName, O_RDWR_FS, 0); global() variable 418 UtilsFileClose(fd); global() variable 433 int fd = UtilsFileOpen(fileName, O_RDWR_FS, 0); global() variable 436 UtilsFileClose(fd); global() variable 451 int fd = UtilsFileOpen(fileName, O_RDWR_FS, 0); global() variable 454 UtilsFileClose(fd); global() variable 469 int fd = UtilsFileOpen(fileName, O_RDWR_FS, 0); global() variable 472 UtilsFileClose(fd); global() variable 487 int fd = UtilsFileOpen(fileName, O_RDWR_FS, 0); global() variable 490 UtilsFileClose(fd); global() variable 505 int fd = UtilsFileOpen(fileName, O_RDWR_FS, 0); global() variable 509 UtilsFileClose(fd); global() variable 524 int fd = UtilsFileOpen(fileName, O_RDWR_FS, 0); global() variable 528 UtilsFileClose(fd); global() variable 543 int fd = UtilsFileOpen(fileName, O_RDWR_FS, 0); global() variable 547 UtilsFileClose(fd); global() variable 562 int fd = UtilsFileOpen(fileName, O_RDWR_FS, 0); global() variable 566 UtilsFileClose(fd); global() variable 581 int fd = UtilsFileOpen(fileName, O_RDWR_FS, 0); global() variable 586 UtilsFileClose(fd); global() variable 597 int fd = 1073; global() variable 644 int fd = UtilsFileOpen(fileName, O_RDWR_FS, 0); global() variable 647 UtilsFileClose(fd); global() variable 659 int fd = 1073; global() variable [all...] |
/test/xts/hats/kernel/syscalls/async/inotify/ |
H A D | InotifyApiTest.cpp | 78 int fd = inotify_init1(0); in HWTEST_F() local 79 EXPECT_TRUE(fd >= 0); in HWTEST_F() 81 int wd = inotify_add_watch(fd, TEST_FILE, IN_ACCESS); in HWTEST_F() 84 int ret = inotify_rm_watch(fd, wd); in HWTEST_F() 87 close(fd); in HWTEST_F() 103 int fd = inotify_init1(IN_NONBLOCK); in HWTEST_F() local 104 EXPECT_TRUE(fd >= 0); in HWTEST_F() 106 int wd = inotify_add_watch(fd, TEST_FILE, IN_MODIFY | IN_ATTRIB | IN_CLOSE); in HWTEST_F() 109 int ret = inotify_rm_watch(fd, wd); in HWTEST_F() 112 close(fd); in HWTEST_F() 128 int fd = inotify_init1(IN_CLOEXEC); HWTEST_F() local 153 int fd = inotify_init1(IN_CLOEXEC); HWTEST_F() local 178 int fd = inotify_init1(IN_CLOEXEC); HWTEST_F() local 203 int fd = inotify_init1(IN_CLOEXEC); HWTEST_F() local 227 int fd = inotify_init1(IN_CLOEXEC); HWTEST_F() local 252 int fd = inotify_init1(IN_CLOEXEC); HWTEST_F() local 274 int fd = inotify_init1(IN_CLOEXEC); HWTEST_F() local 298 int fd = inotify_init1(IN_CLOEXEC); HWTEST_F() local [all...] |
/test/xts/hats/kernel/accesstokenid/ |
H A D | accesstokenid_test.cpp | 76 int fd; in GenRand64() local 78 fd = open("/dev/random", O_RDONLY); in GenRand64() 79 if (fd > 0) { in GenRand64() 80 read(fd, &randvalue, sizeof(unsigned long long)); in GenRand64() 82 close(fd); in GenRand64() 92 int fd = open(dev_accesstokenid, O_RDWR); in GetTokenid() local 93 if (fd < 0) { in GetTokenid() 98 int ret = ioctl(fd, ACCESS_TOKENID_GET_TOKENID, token); in GetTokenid() 101 close(fd); in GetTokenid() 105 close(fd); in GetTokenid() 111 int fd = open(dev_accesstokenid, O_RDWR); SetTokenid() local 130 int fd = open(dev_accesstokenid, O_RDWR); GetfTokenid() local 149 int fd = open(dev_accesstokenid, O_RDWR); SetfTokenid() local 372 int fd = open(dev_accesstokenid, O_RDWR); HWTEST_F() local 392 int fd = open(dev_accesstokenid, O_RDWR); HWTEST_F() local 412 int fd = open(dev_accesstokenid, O_RDWR); HWTEST_F() local 432 int fd = open(dev_accesstokenid, O_RDWR); HWTEST_F() local 454 int fd = open(dev_accesstokenid, O_RDWR); HWTEST_F() local 484 int fd = open(dev_accesstokenid, O_RDWR); HWTEST_F() local 512 int fd = open(dev_accesstokenid, O_RDWR); HWTEST_F() local 542 int fd = open(dev_accesstokenid, O_RDWR); HWTEST_F() local 572 int fd = open(dev_accesstokenid, O_RDWR); HWTEST_F() local 602 int fd = open(dev_accesstokenid, O_RDWR); HWTEST_F() local 632 int fd = open(dev_accesstokenid, O_RDWR); HWTEST_F() local [all...] |
/test/xts/acts/multimedia/av_codec/demuxer/src/ |
H A D | func_test.cpp | 186 * @tc.name : create source with fd but no permission 192 int fd = open(file, O_RDONLY); in HWTEST_F() local 194 cout << file << "----------------------" << fd << "---------" << size << endl; in HWTEST_F() 196 source = OH_AVSource_CreateWithFD(fd, 0, size); in HWTEST_F() 200 close(fd); in HWTEST_F() 205 * @tc.name : create source with invalid fd 211 int fd = open(file, O_RDONLY); in HWTEST_F() local 213 cout << file << "----------------------" << fd << "---------" << size << endl; in HWTEST_F() 214 source = OH_AVSource_CreateWithFD(fd, 0, size); in HWTEST_F() 216 close(fd); in HWTEST_F() 231 int fd = open(file, O_RDONLY); HWTEST_F() local 279 int fd = open(file, O_RDONLY); HWTEST_F() local 337 int fd = open(file, O_RDONLY); HWTEST_F() local 394 int fd = open(file, O_RDONLY); HWTEST_F() local 451 int fd = open(file, O_RDONLY); HWTEST_F() local 502 int fd = open(file, O_RDONLY); HWTEST_F() local 551 int fd = open(file, O_RDONLY); HWTEST_F() local 600 int fd = open(file, O_RDONLY); HWTEST_F() local 649 int fd = open(file, O_RDONLY); HWTEST_F() local 699 int fd = open(file, O_RDONLY); HWTEST_F() local 751 int fd = open(file, O_RDONLY); HWTEST_F() local 804 int fd = open(file, O_RDONLY); HWTEST_F() local 820 int fd = open(file, O_RDONLY); HWTEST_F() local 851 int fd = open(file, O_RDONLY); HWTEST_F() local 908 int fd = open(file, O_RDONLY); HWTEST_F() local 967 int fd = open(file, O_RDONLY); HWTEST_F() local 1023 int fd = open(file, O_RDONLY); HWTEST_F() local 1077 int fd = open(file, O_RDONLY); HWTEST_F() local 1133 int fd = open(file, O_RDONLY); HWTEST_F() local 1195 int fd = open(file, O_RDONLY); HWTEST_F() local 1256 int fd = open(file, O_RDONLY); HWTEST_F() local 1316 int fd = open(file, O_RDONLY); HWTEST_F() local 1371 int fd = open(file, O_RDONLY); HWTEST_F() local 1427 int fd = open(file, O_RDONLY); HWTEST_F() local 1486 int fd = open(file, O_RDONLY); HWTEST_F() local [all...] |
H A D | proc_test.cpp | 157 int fd = open(file, O_RDONLY); in HWTEST_F() local 159 cout << file << "----------------------" << fd << "---------" << size << endl; in HWTEST_F() 160 source = OH_AVSource_CreateWithFD(fd, 0, size); in HWTEST_F() 196 close(fd); in HWTEST_F() 212 int fd = open(file, O_RDONLY); in HWTEST_F() local 214 cout << file << "----------------------" << fd << "---------" << size << endl; in HWTEST_F() 215 source = OH_AVSource_CreateWithFD(fd, 0, size); in HWTEST_F() 251 close(fd); in HWTEST_F() 266 int fd = open(file, O_RDONLY); in HWTEST_F() local 268 cout << file << "----------------------" << fd << " in HWTEST_F() 318 int fd = open(file, O_RDONLY); HWTEST_F() local 370 int fd = open(file, O_RDONLY); HWTEST_F() local 417 int fd = open(file, O_RDONLY); HWTEST_F() local 450 int fd = open(file, O_RDONLY); HWTEST_F() local 502 int fd = open(file, O_RDONLY); HWTEST_F() local 554 int fd = open(file, O_RDONLY); HWTEST_F() local 603 int fd = open(file, O_RDONLY); HWTEST_F() local 636 int fd = open(file, O_RDONLY); HWTEST_F() local 699 int fd = open(file, O_RDONLY); HWTEST_F() local 737 int fd = open(file, O_RDONLY); HWTEST_F() local 790 int fd = open(file, O_RDONLY); HWTEST_F() local 823 int fd = open(file, O_RDONLY); HWTEST_F() local 856 int fd = open(file, O_RDONLY); HWTEST_F() local 880 int fd = open(file, O_RDONLY); HWTEST_F() local 914 int fd = open(file, O_RDONLY); HWTEST_F() local 938 int fd = open(file, O_RDONLY); HWTEST_F() local 983 int fd = open(file, O_RDONLY); HWTEST_F() local 1021 int fd = open(file, O_RDONLY); HWTEST_F() local [all...] |
/test/xts/hats/kernel/syscalls/fileio/fcntl/ |
H A D | FcntlApiTest.cpp | 60 * @tc.desc : fcntl get fd flag and set fd flag success. 69 int fd = open(TEST_FILE, O_RDWR | O_CREAT | O_TRUNC, MODE_0644); in HWTEST_F() local 70 EXPECT_TRUE(fd > 0); in HWTEST_F() 72 ret = fcntl(fd, F_SETFD, FD_CLOEXEC); in HWTEST_F() 75 flags = fcntl(fd, F_GETFD); in HWTEST_F() 78 ret = fcntl(fd, F_SETFL, O_NONBLOCK); in HWTEST_F() 81 flags = fcntl(fd, F_GETFL); in HWTEST_F() 84 close(fd); in HWTEST_F() 99 int fd in HWTEST_F() local 153 int fd = open(TEST_FILE, O_RDWR | O_CREAT, MODE_0644); HWTEST_F() local 176 int fd = open(TEST_FILE, O_RDWR | O_CREAT, MODE_0644); HWTEST_F() local 201 int fd = open(TEST_FILE, O_RDWR | O_CREAT, MODE_0644); HWTEST_F() local 229 int fd = open(TEST_FILE, O_RDWR | O_CREAT, MODE_0644); HWTEST_F() local 280 int fd = open(TEST_FILE, O_RDWR | O_CREAT | O_TRUNC, MODE_0644); HWTEST_F() local [all...] |
/test/xts/hats/kernel/syscalls/fileio/lseek/ |
H A D | LseekApiTest.cpp | 45 int fd = open(TEST_FILE, O_WRONLY | O_CREAT, 0644); in SetUp() local 46 write(fd, TEST_DATA, TEST_LEN); in SetUp() 47 close(fd); in SetUp() 70 int fd = open(TEST_FILE, O_WRONLY | O_CREAT, 0644); in HWTEST_F() local 71 EXPECT_TRUE(fd > 0); in HWTEST_F() 75 off_t pos = lseek(fd, offset, SEEK_SET); in HWTEST_F() 80 pos = lseek(fd, offset, SEEK_SET); in HWTEST_F() 85 pos = lseek(fd, offset, SEEK_SET); in HWTEST_F() 91 pos = lseek(fd, offset, SEEK_SET); in HWTEST_F() 94 close(fd); in HWTEST_F() 107 int fd = open(TEST_FILE, O_WRONLY | O_CREAT, 0644); HWTEST_F() local 129 int fd = open(TEST_FILE, O_WRONLY | O_CREAT, 0644); HWTEST_F() local 167 int fd = open(TEST_FILE, O_WRONLY | O_CREAT, 0644); HWTEST_F() local 190 int fd = open(TEST_FILE, O_WRONLY | O_CREAT, 0644); HWTEST_F() local [all...] |
/test/xts/acts/commonlibrary/thirdparty/musl/entry/src/main/cpp/ |
H A D | pollndk.cpp | 57 int fd = open("ppoll_function_file", O_RDWR | O_CREAT, PARAM_0777);
in Ppoll() local 58 struct pollfd pollfds[] = {{.fd = fd, .events = POLLIN, .revents = PARAM_0}};
in Ppoll() 63 close(fd);
in Ppoll() 74 int fd[2];
in PollChk() local 75 pipe(fd);
in PollChk() 81 close(fd[0]);
in PollChk() 83 write(fd[1], message, strlen(message) + 1);
in PollChk() 84 close(fd[1]);
in PollChk() 87 close(fd[ in PollChk() 104 int fd[2]; PpollChk() local [all...] |
H A D | xattrndk.cpp | 54 int fd = open("/data/storage/el2/base/files/test.txt", O_RDWR | O_CREAT, perms);
in Lgetxattr() local 56 write(fd, str, sizeof(str));
in Lgetxattr() 57 close(fd);
in Lgetxattr() 81 int fd = open("/data/storage/el2/base/files/test.txt", O_RDWR | O_CREAT, perms);
in Setxattr() local 84 write(fd, str, sizeof(str));
in Setxattr() 85 close(fd);
in Setxattr() 102 int fd = open("/data/storage/el2/base/files/test.txt", O_RDWR | O_CREAT, perms);
in Getxattr() local 105 write(fd, str, sizeof(str));
in Getxattr() 106 close(fd);
in Getxattr() 129 int fd in Listxattr() local 157 int fd = open("/data/storage/el2/base/files/test.txt", O_RDWR | O_CREAT, perms); LListxattr() local 198 int fd = open("/data/storage/el2/base/files/test.txt", O_RDWR | O_CREAT, perms); Lsetxattr() local 216 int fd = open(path, O_CREAT | O_WRONLY, PARAM_0667); Removexattr() local 228 int fd = open(path, O_CREAT | O_WRONLY, PARAM_0667); Lremovexattr() local 244 int fd = open(path, O_CREAT | O_WRONLY, PARAM_0667); Fremovexattr() local 259 int fd = open(path, O_CREAT | O_WRONLY, PARAM_0667); Fsetxattr() local [all...] |
/test/xts/hats/kernel/syscalls/fileio/write/ |
H A D | WriteApiTest.cpp | 68 int fd; in HWTEST_F() local 72 fd = open(WRITE_TEST_FILE, O_WRONLY | O_CREAT | O_TRUNC, 0644); in HWTEST_F() 73 EXPECT_TRUE(fd >= 3); in HWTEST_F() 75 ret = write(fd, TEST_DATA, TEST_DATA_LEN); in HWTEST_F() 77 close(fd); in HWTEST_F() 79 fd = open(WRITE_TEST_FILE, O_RDONLY); in HWTEST_F() 80 EXPECT_TRUE(fd >= 3); in HWTEST_F() 81 ret = read(fd, buf, TEST_DATA_LEN); in HWTEST_F() 82 close(fd); in HWTEST_F() 93 * @tc.desc : write to invalid fd fai 101 int fd; HWTEST_F() local 131 int fd; HWTEST_F() local 164 int fd; HWTEST_F() local [all...] |
/test/xts/hats/kernel/syscalls/net/sockopt/ |
H A D | SockoptApiTest.cpp | 208 int fd = -1; in HWTEST_F() local 212 fd = socket(g_setOpt[i].domain, g_setOpt[i].type, 0); in HWTEST_F() 213 EXPECT_TRUE(fd > 0); in HWTEST_F() 215 ret = setsockopt(fd, g_setOpt[i].optLevel, g_setOpt[i].optName, &g_setOpt[i].optVal, g_setOpt[i].optLen); in HWTEST_F() 221 close(fd); in HWTEST_F() 226 ret = getsockopt(fd, g_setOpt[i].optLevel, g_setOpt[i].optName, &optVal, &optLen); in HWTEST_F() 230 close(fd); in HWTEST_F() 233 close(fd); in HWTEST_F() 247 int fd = -1; in HWTEST_F() local 251 fd in HWTEST_F() 294 int fd = -1; HWTEST_F() local 326 int fd = -1; HWTEST_F() local 357 int fd = -1; HWTEST_F() local 393 int fd = -1; HWTEST_F() local 429 int fd = -1; HWTEST_F() local 487 int fd = -1; HWTEST_F() local 518 int fd = -1; HWTEST_F() local [all...] |
/test/xts/hats/kernel/syscalls/fileio/utimensat/ |
H A D | UtimensatApiTest.cpp | 72 int fd; in HWTEST_F() local 77 fd = open(UTIMENSAT_TEST_FILE, O_RDONLY); in HWTEST_F() 78 if (fd != -1) { in HWTEST_F() 82 close(fd); in HWTEST_F() 84 fd = open(UTIMENSAT_TEST_FILE, O_RDONLY | O_CREAT | O_TRUNC, 0644); in HWTEST_F() 85 EXPECT_TRUE(fd >= 3); in HWTEST_F() 86 close(fd); in HWTEST_F() 121 int fd; in HWTEST_F() local 125 fd = open(UTIMENSAT_TEST_FILE, O_RDONLY); in HWTEST_F() 126 if (fd ! in HWTEST_F() 163 int fd; HWTEST_F() local 197 int fd; HWTEST_F() local [all...] |
/test/xts/hats/kernel/syscalls/fileio/fsetxattr/ |
H A D | FsetxattrApiTest.cpp | 74 int fd = open(TEST_FILE, O_RDWR | O_CREAT, MODE_0644); in HWTEST_F() local 75 EXPECT_TRUE(fd > 0); in HWTEST_F() 77 ret = fsetxattr(fd, XATTR_NAME, AUTHOR_NAME, g_length, 0); in HWTEST_F() 79 ret = fgetxattr(fd, XATTR_NAME, buf, g_length); in HWTEST_F() 83 close(fd); in HWTEST_F() 118 int fd = open(TEST_FILE, O_RDWR | O_CREAT, MODE_0644); in HWTEST_F() local 119 EXPECT_TRUE(fd > 0); in HWTEST_F() 121 ret = fsetxattr(fd, XATTR_NAME, AUTHOR_NAME, g_length, 0); in HWTEST_F() 124 ret = fsetxattr(fd, XATTR_NAME, AUTHOR_NAME_NEW, g_length, XATTR_CREATE); in HWTEST_F() 127 ret = fgetxattr(fd, XATTR_NAM in HWTEST_F() 147 int fd = open(TEST_FILE, O_RDWR | O_CREAT, MODE_0644); HWTEST_F() local 172 int fd = open(TEST_FILE, O_RDWR | O_CREAT, MODE_0644); HWTEST_F() local 195 int fd = open(TEST_FILE, O_RDWR | O_CREAT, MODE_0644); HWTEST_F() local [all...] |
/test/xts/hats/kernel/syscalls/fileio/dup3/ |
H A D | Dup3ApiTest.cpp | 54 * @tc.desc : dup3 file fd success. 61 int fd = -1; in HWTEST_F() local 69 fd = dup3(oldFd, newFd, 0); in HWTEST_F() 70 EXPECT_TRUE(fd >= 0); in HWTEST_F() 71 EXPECT_EQ(fd, newFd); in HWTEST_F() 75 close(fd); in HWTEST_F() 83 * @tc.desc : dup3 force set the close-on-exec flag to the new fd success. 91 int fd = -1; in HWTEST_F() local 99 fd = dup3(oldFd, newFd, O_CLOEXEC); in HWTEST_F() 100 EXPECT_TRUE(fd > in HWTEST_F() 122 int fd = -1; HWTEST_F() local 148 int fd = -1; HWTEST_F() local [all...] |
/test/xts/acts/kernel_lite/mem_posix/src/ |
H A D | MmapApiTest.cpp | 324 int fd = open(file, O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO); in HWTEST_F() local 325 ASSERT_TRUE(fd != -1) << "ERROR: open() == -1"; in HWTEST_F() 327 int wByte = write(fd, buf, len); in HWTEST_F() 330 char *mem = (char *)mmap(nullptr, len, prot, flags, fd, 0); in HWTEST_F() 350 EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; in HWTEST_F() 370 int fd = open(file, O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO); in HWTEST_F() local 371 ASSERT_TRUE(fd != -1) << "ERROR: open() == -1"; in HWTEST_F() 373 int wByte = write(fd, buf, len); in HWTEST_F() 376 char *mem = (char *)mmap(nullptr, len, prot, flags, fd, 0); in HWTEST_F() 396 EXPECT_TRUE(close(fd) ! in HWTEST_F() 415 int fd = open(file, O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO); HWTEST_F() local 456 int fd = open(file, O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO); HWTEST_F() local 502 int fd = open(file, O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO); HWTEST_F() local 549 int fd = open(file, O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO); HWTEST_F() local 596 int fd = open(file, O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO); HWTEST_F() local 710 int fd = open(file, O_CREAT | O_RDWR, 0777); HWTEST_F() local 764 int fd; HWTEST_F() local 810 int fd = open(file, O_CREAT | O_RDWR, 0777); HWTEST_F() local 838 int fd = open(file, O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO); HWTEST_F() local [all...] |
/test/xts/hats/kernel/syscalls/fileio/writev/ |
H A D | WritevApiTest.cpp | 74 int fd; in HWTEST_F() local 90 fd = open(WRITEV_TEST_FILE, O_WRONLY | O_CREAT | O_TRUNC, 0644); in HWTEST_F() 91 EXPECT_TRUE(fd >= 3); in HWTEST_F() 93 ret = writev(fd, vec, VEC_LEN); in HWTEST_F() 95 close(fd); in HWTEST_F() 97 fd = open(WRITEV_TEST_FILE, O_RDONLY); in HWTEST_F() 98 EXPECT_TRUE(fd >= 3); in HWTEST_F() 99 ret = read(fd, readBuf, TEST_DATA_LEN); in HWTEST_F() 104 close(fd); in HWTEST_F() 165 int fd; in HWTEST_F() local 204 int fd; HWTEST_F() local 238 int fd; HWTEST_F() local [all...] |
/test/xts/hats/kernel/syscalls/fileio/fchownat/ |
H A D | FchownatApiTest.cpp | 78 int fd = open(TEST_FILE, O_RDWR | O_CREAT, MODE_0755); in HWTEST_F() local 79 EXPECT_TRUE(fd > 0); in HWTEST_F() 80 ret = fstat(fd, &stat1); in HWTEST_F() 87 ret = fstat(fd, &stat2); in HWTEST_F() 92 close(fd); in HWTEST_F() 110 int fd = 0; in HWTEST_F() local 117 fd = open(TEST_FILE_NAME, O_RDWR | O_CREAT, MODE_0644); in HWTEST_F() 120 ret = fstat(fd, &stat1); in HWTEST_F() 127 ret = fstat(fd, &stat2); in HWTEST_F() 132 close(fd); in HWTEST_F() 172 int fd = open(TEST_FILE, O_RDWR | O_CREAT, MODE_0755); HWTEST_F() local 215 int fd = open(TEST_FILE_NAME, O_RDWR | O_CREAT, MODE_0644); HWTEST_F() local 252 int fd = open(TEST_FILE, O_RDWR | O_CREAT, 0644); HWTEST_F() local [all...] |
/test/xts/hats/kernel/syscalls/mem/msync/ |
H A D | MsyncApiTest.cpp | 73 int fd = open(TEST_FILE, O_RDWR | O_CREAT, 0666); in HWTEST_F() local 74 EXPECT_TRUE(fd > 0); in HWTEST_F() 76 ftruncate(fd, SIZE); in HWTEST_F() 80 void *addr = mmap(nullptr, SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); in HWTEST_F() 95 lseek(fd, 0, SEEK_SET); in HWTEST_F() 97 read(fd, buffer, SIZE); in HWTEST_F() 101 close(fd); in HWTEST_F() 114 int fd = open(TEST_FILE, O_RDWR | O_CREAT, 0666); in HWTEST_F() local 115 EXPECT_TRUE(fd > 0); in HWTEST_F() 117 ftruncate(fd, SIZ in HWTEST_F() 152 int fd = open(TEST_FILE, O_RDWR | O_CREAT, 0666); HWTEST_F() local [all...] |
/test/xts/hats/kernel/syscalls/fileio/memfdcreate/ |
H A D | MemFdCreateApiTest.cpp | 52 * @tc.desc : memfd_create create fd success. 59 int fd = memfd_create(SHMEM_NAME, 0); in HWTEST_F() local 60 EXPECT_TRUE(fd > 0); in HWTEST_F() 61 close(fd); in HWTEST_F() 63 fd = memfd_create(SHMEM_NAME, MFD_ALLOW_SEALING); in HWTEST_F() 64 EXPECT_TRUE(fd > 0); in HWTEST_F() 65 close(fd); in HWTEST_F() 67 fd = memfd_create(SHMEM_NAME, MFD_CLOEXEC); in HWTEST_F() 68 EXPECT_TRUE(fd > 0); in HWTEST_F() 69 close(fd); in HWTEST_F() 83 int fd = memfd_create(nullptr, 0); HWTEST_F() local 100 int fd = memfd_create(SHMEM_NAME, -1); HWTEST_F() local [all...] |
/test/xts/hats/kernel/syscalls/ns/setns/ |
H A D | SetnsApiTest.cpp | 72 int fd = open(path, O_RDONLY); in HWTEST_F() local 73 EXPECT_TRUE(fd > 0); in HWTEST_F() 75 ret = setns(fd, CLONE_NEWIPC); in HWTEST_F() 77 close(fd); in HWTEST_F() 83 fd = open(path, O_RDONLY); in HWTEST_F() 84 EXPECT_TRUE(fd > 0); in HWTEST_F() 86 ret = setns(fd, CLONE_NEWNET); in HWTEST_F() 88 close(fd); in HWTEST_F() 94 fd = open(path, O_RDONLY); in HWTEST_F() 95 EXPECT_TRUE(fd > in HWTEST_F() [all...] |