/test/xts/acts/kernel_lite/ipc_posix/pipe_fifo/ |
D | PipeTest.cpp | 41 int fd[2]; variable 45 ret = pipe(fd); 51 close(fd[1]); 52 if (read(fd[0], readBuffer, 20) == -1) { 53 close(fd[0]); 57 close(fd[0]); 60 close(fd[0]); 65 close(fd[0]); 66 ret = write(fd[1], "hello world", sizeof("hello world")); 68 close(fd[1]); [all …]
|
D | FifoTest.cpp | 51 int fd; variable 58 fd = open(FIFO_PATH, O_WRONLY, S_IRUSR|S_IWUSR); 59 write(fd, sentence, sizeof(sentence)); 61 close(fd); 67 fd = open(FIFO_PATH, O_RDONLY, S_IRUSR|S_IWUSR); 68 EXPECT_NE(fd, -1) << "> open faild errno = " << errno; 69 EXPECT_NE(read(fd, buffer, sizeof(buffer)), -1) << "> read errno = " << errno; 72 close(fd); 108 int fd = -1; variable 124 fd = open(FIFO_PATH, O_RDONLY, S_IRUSR|S_IWUSR); [all …]
|
/test/xts/acts/kernel_lite/fs_posix/src/ |
D | FsFcntlTest.cpp | 46 int fd = 0; variable 47 EXPECT_NE((fd = open(FILE0, O_CREAT | O_RDWR, 0777)), -1) << "> open faild errno = " << errno; 48 WriteCloseTest(fd); 52 EXPECT_NE((fd = open(FILE0, O_RDONLY, 0777)), -1) << "> open faild errno = " << errno; 54 EXPECT_EQ((fdNew = fcntl(fd, F_DUPFD)), -1) << "> fcntl errno = " << errno; 58 EXPECT_NE(close(fd), -1) << "> close errno = " << errno; 69 int fd = 0; variable 70 EXPECT_NE((fd = open(FILE0, O_CREAT | O_RDWR, 0777)), -1) << "> open faild errno = " << errno; 71 WriteCloseTest(fd); 74 EXPECT_NE((fd = open(FILE0, flagReadWrite, 0777)), -1) << "> open faild errno = " << errno; [all …]
|
D | FsUnistdTest.cpp | 43 int fd = 0; variable 44 fd = creat(FILE0, 0777); 45 EXPECT_NE(fd, -1) << "> creat faild errno = " << errno; 46 EXPECT_NE(close(fd), -1) << "> close errno = " << errno; 69 int fd = 0; variable 70 fd = creat(FILE0, 0777); 71 EXPECT_NE(fd, -1) << "> creat faild errno = " << errno; 72 EXPECT_NE(close(fd), -1) << "> close errno = " << errno; 85 int fd = 0; variable 86 fd = creat(FILE0, 0777); [all …]
|
/test/xts/acts/storage/storagefileiojstest/src/main/js/test/module_fileio/members/ |
D | write.test.js | 37 let fd = fileio.openSync(fpath, 0o102, 0o666); 38 expect(isIntNum(fd)).assertTrue(); 39 expect(fileio.writeSync(fd, FILE_CONTENT) == FILE_CONTENT.length).assertTrue(); 40 expect(fileio.closeSync(fd) == null).assertTrue(); 61 let fd = fileio.openSync(fpath, 0o102, 0o666); 62 expect(isIntNum(fd)).assertTrue(); 64 fileio.writeSync(fd, FILE_CONTENT, { 68 expect(fileio.closeSync(fd) == null).assertTrue(); 89 let fd = fileio.openSync(fpath, 0o102, 0o666); 90 expect(isIntNum(fd)).assertTrue(); [all …]
|
D | read.test.js | 38 let fd = fileio.openSync(fpath, 0o2); 39 expect(isIntNum(fd)).assertTrue(); 40 let len = fileio.readSync(fd, new ArrayBuffer(4096)); 42 expect(fileio.closeSync(fd) == null).assertTrue(); 66 let fd = fileio.openSync(fpath, 0o2); 67 expect(isIntNum(fd)).assertTrue(); 68 let len = fileio.readSync(fd, new ArrayBuffer(bufLen), { 72 expect(fileio.closeSync(fd) == null).assertTrue(); 94 let fd = fileio.openSync(fpath, 0o2); 95 expect(isIntNum(fd)).assertTrue(); [all …]
|
D | fstat.test.js | 38 let fd = fileio.openSync(fpath, 0o2); 39 expect(isIntNum(fd)).assertTrue(); 40 let stat = fileio.fstatSync(fd); 42 fileio.closeSync(fd); 83 let fd = fileio.openSync(fpath); 84 let stat = fileio.fstatSync(fd); 86 expect(fileio.closeSync(fd) == null).assertTrue(); 108 let fd = fileio.openSync(fpath); 109 let stat = fileio.fstatSync(fd); 111 expect(fileio.closeSync(fd) == null).assertTrue(); [all …]
|
D | open.test.js | 57 fileio.open(fpath, 0, 0o0400, function (err, fd) { argument 58 fileio.read(fd, new ArrayBuffer(4096)) 61 fileio.closeSync(fd); 86 await fileio.open(fpath, 0, 0o0400, function (err, fd) { argument 87 fileio.read(fd, new ArrayBuffer(4096)) 90 fileio.closeSync(fd); 114 await fileio.open(fpath, 0, function (err, fd) { argument 115 fileio.read(fd, new ArrayBuffer(4096)) 118 fileio.closeSync(fd); 142 fileio.open(fpath, 0o2, function (err, fd) { argument [all …]
|
D | ftruncate.test.js | 36 let fd = fileio.openSync(fpath, 0o2); 37 expect(isIntNum(fd)).assertTrue(); 40 fileio.ftruncate(fd, truncateLen, function (err) { 41 let len = fileio.readSync(fd, new ArrayBuffer(4096)); 43 expect(fileio.closeSync(fd) == null).assertTrue(); 65 let fd = fileio.openSync(fpath, 0o2); 66 expect(isIntNum(fd)).assertTrue(); 69 fileio.ftruncate(fd, truncateLen) 72 let len = fileio.readSync(fd, new ArrayBuffer(4096)); 74 expect(fileio.closeSync(fd) == null).assertTrue(); [all …]
|
D | posix_fallocate.test.js | 37 let fd = fileio.openSync(fpath, 0o102, 0o666); 38 expect(isIntNum(fd)).assertTrue(); 39 fileio.posixFallocateSync(fd, 100, 999); 40 expect(fileio.closeSync(fd) == null).assertTrue(); 61 let fd = fileio.openSync(fpath, 0o2); 62 expect(isIntNum(fd)).assertTrue(); 63 await fileio.posixFallocate(fd, 100, 999, function (err) { 64 expect(fileio.closeSync(fd) == null).assertTrue(); 87 let fd = fileio.openSync(fpath, 0o2); 88 expect(isIntNum(fd)).assertTrue(); [all …]
|
D | truncate.test.js | 40 let fd = fileio.openSync(fpath, 0o2); 41 expect(isIntNum(fd)).assertTrue(); 42 let len = fileio.readSync(fd, new ArrayBuffer(4096)); 44 expect(fileio.closeSync(fd) == null).assertTrue(); 73 let fd = fileio.openSync(fpath, 0o2); 74 expect(isIntNum(fd)).assertTrue(); 75 let len = fileio.readSync(fd, new ArrayBuffer(4096)); 77 expect(fileio.closeSync(fd) == null).assertTrue(); 129 let fd = fileio.openSync(fpath, 0o2); 130 expect(isIntNum(fd)).assertTrue(); [all …]
|
D | open_close.test.js | 37 let fd = fileio.openSync(fpath, 0o102, 0o666); 38 expect(isIntNum(fd)).assertTrue(); 39 expect(fileio.closeSync(fd) == null).assertTrue(); 61 let fd = fileio.openSync(fpath); 62 expect(isIntNum(fd)).assertTrue(); 63 expect(fileio.closeSync(fd) == null).assertTrue(); 122 let fd; 125 fd = fileio.openSync(fpath, undefined, undefined); 126 expect(isIntNum(fd)).assertTrue(); 127 let readLen = fileio.readSync(fd, new ArrayBuffer(4096)); [all …]
|
D | lseek.test.js | 37 let fd = fileio.openSync(fpath, 0o2); 38 await fileio.lseek(fd, -1, 2, function (err) { 39 expect(fileio.closeSync(fd) == null).assertTrue(); 62 let fd = fileio.openSync(fpath, 0o2); 63 let num = await fileio.lseek(fd, -1, 2); 65 expect(fileio.closeSync(fd) == null).assertTrue(); 88 let fd = fileio.openSync(fpath, 0o102, 0o666); 89 let num = fileio.lseekSync(fd, -1, 2); 91 expect(fileio.closeSync(fd) == null).assertTrue(); 113 let fd = fileio.openSync(fpath, 0o102, 0o666); [all …]
|
D | fsync.test.js | 38 let fd = fileio.openSync(fpath, 0o2); 39 expect(fileio.fsyncSync(fd) == null).assertTrue(); 40 expect(fileio.closeSync(fd) == null).assertTrue(); 80 let fd = fileio.openSync(fpath, 0o2); 81 await fileio.fsync(fd); 82 expect(fileio.closeSync(fd) == null).assertTrue(); 105 let fd = fileio.openSync(fpath, 0o2); 106 fileio.fsync(fd, function (error) { 107 expect(fileio.closeSync(fd) == null).assertTrue(); 128 let fd = -1; [all …]
|
/test/xts/hats/kernel/accesstokenid/ |
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() [all …]
|
/test/xts/acts/commonlibrary_lite/file_hal/src/ |
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 = UtilsFileOpen(fileName, O_RDONLY_FS, 0); variable [all …]
|
/test/xts/acts/storage/storagefileiojstest/src/main/js/test/ |
D | FileIO.test.js | 39 let fd = fileio.openSync(fpath, 0o102, 0o666); 40 expect(fd !== null).assertTrue(); 41 fileio.closeSync(fd); 59 let fd = fileio.openSync(fpath, 0o202); 60 expect(fd !== null).assertTrue(); 61 fileio.closeSync(fd); 79 let fd = fileio.openSync(fpath, 0o100, 0o001); 80 expect(fd !== null).assertTrue(); 81 fileio.closeSync(fd); 99 let fd = fileio.openSync(fpath); [all …]
|
D | Common.js | 29 let fd = fileio.openSync(fpath, 0o102, 0o666) 30 fileio.ftruncateSync(fd) 31 fileio.writeSync(fd, content) 32 fileio.fsyncSync(fd) 33 fileio.closeSync(fd) 43 let fd = fileio.openSync(fpath, 0o102, 0o777) 44 fileio.closeSync(fd) 54 let fd = fileio.openSync(fpath, 0o1) 55 fileio.fchmodSync(fd, 0o444) 56 fileio.fsyncSync(fd) [all …]
|
/test/xts/acts/commonlibrary/thirdparty/musl/entry/src/main/cpp/ |
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[1]); in PollChk() 88 struct pollfd buf[2] = {{fd[0], POLLIN, PARAM_0}, {fd[0], POLLIN, PARAM_0}}; in PollChk() [all …]
|
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 = open("/data/storage/el2/base/files/test.txt", O_RDWR | O_CREAT, perms); in Listxattr() local [all …]
|
/test/xts/acts/multimedia/av_codec/demuxer/src/ |
D | func_test.cpp | 192 int fd = open(file, O_RDONLY); variable 194 cout << file << "----------------------" << fd << "---------" << size << endl; 196 source = OH_AVSource_CreateWithFD(fd, 0, size); 200 close(fd); 211 int fd = open(file, O_RDONLY); variable 213 cout << file << "----------------------" << fd << "---------" << size << endl; 214 source = OH_AVSource_CreateWithFD(fd, 0, size); 216 close(fd); 231 int fd = open(file, O_RDONLY); variable 233 cout << file << "----------------------" << fd << "---------" << size << endl; [all …]
|
/test/xts/device_attest_lite/services/core/mini/utils/ |
D | attest_utils_file_detail.c | 87 int32_t fd = UtilsFileOpen(fileName, O_CREAT_FS | O_TRUNC_FS | O_RDWR_FS, 0); in WriteFile() local 88 if (fd < 0) { in WriteFile() 94 if (UtilsFileWrite(fd, data, dataLen) != (int32_t)dataLen) { in WriteFile() 98 (void)UtilsFileClose(fd); in WriteFile() 118 int32_t fd = UtilsFileOpen(fileName, O_EXCL_FS | O_RDWR_FS, 0); in ReadFile() local 119 if (fd < 0) { in ReadFile() 125 ret = UtilsFileRead(fd, buffer, bufferLen); in ReadFile() 126 (void)UtilsFileClose(fd); in ReadFile() 139 int32_t fd = UtilsFileOpen(fileName, O_CREAT_FS, 0); in CreateFile() local 140 if (fd < 0) { in CreateFile() [all …]
|
/test/xts/acts/storage/storagefileiov9jstest/src/main/js/test/members/ |
D | write.test.js | 39 expect(isIntNum(file.fd)).assertTrue(); 40 let bytesWritten1 = fileIO.writeSync(file.fd, FILE_CONTENT); 42 let bytesWritten2 = fileIO.writeSync(file.fd, new ArrayBuffer(FILE_CONTENT.length)); 44 let readLen = fileIO.readSync(file.fd, new ArrayBuffer(4096), { offset: 0 }); 70 expect(isIntNum(file.fd)).assertTrue(); 71 let bytesWritten = fileIO.writeSync(file.fd, FILE_CONTENT, { 99 expect(isIntNum(file.fd)).assertTrue(); 100 let bytesWritten = fileIO.writeSync(file.fd, FILE_CONTENT, { 128 expect(isIntNum(file.fd)).assertTrue(); 129 let bytesWritten = fileIO.writeSync(file.fd, FILE_CONTENT, { [all …]
|
/test/xts/acts/useriam/face_auth/js_api_test/function_test/userauth/src/main/js/MainAbility/pages/index/ |
D | index.js | 33 let fd = fileio.openSync(path, 0o102, 0o666); variable 38 fileio.writeSync(fd, message); 39 fileio.closeSync(fd); 45 let fd = fileio.openSync(path, 0o102, 0o666); 47 fileio.writeSync(fd, message); 48 fileio.closeSync(fd); 54 let fd = fileio.openSync(path, 0o102, 0o666); 56 fileio.writeSync(fd, message); 57 fileio.closeSync(fd);
|
/test/xts/acts/useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/MainAbility/pages/index/ |
D | index.js | 33 let fd = fileio.openSync(path, 0o102, 0o666); variable 38 fileio.writeSync(fd, message); 39 fileio.closeSync(fd); 45 let fd = fileio.openSync(path, 0o102, 0o666); 47 fileio.writeSync(fd, message); 48 fileio.closeSync(fd); 54 let fd = fileio.openSync(path, 0o102, 0o666); 56 fileio.writeSync(fd, message); 57 fileio.closeSync(fd);
|