Lines Matching refs:fd

53   int fd = open("/dev/null", O_RDONLY);  in TEST_F()  local
54 ASSERT_EQ(0, close(fd)); in TEST_F()
60 int fd = open("/dev/null", O_RDONLY); in TEST_F() local
61 ASSERT_EQ(0, android_fdsan_close_with_tag(fd, 0)); in TEST_F()
67 int fd = open("/dev/null", O_RDONLY); in TEST_F() local
68 EXPECT_FDSAN_DEATH(android_fdsan_close_with_tag(fd, 0xdeadbeef), "actually unowned"); in TEST_F()
74 int fd = open("/dev/null", O_RDONLY); in TEST_F() local
75 EXPECT_FDSAN_DEATH(android_fdsan_exchange_owner_tag(fd, 0xbadc0de, 0xdeadbeef), in TEST_F()
82 int fd = open("/dev/null", O_RDONLY); in TEST_F() local
83 android_fdsan_exchange_owner_tag(fd, 0, 0xdeadbeef); in TEST_F()
84 EXPECT_FDSAN_DEATH(close(fd), "expected to be unowned, actually owned"); in TEST_F()
90 int fd = open("/dev/null", O_RDONLY); in TEST_F() local
91 android_fdsan_exchange_owner_tag(fd, 0, 0xdeadbeef); in TEST_F()
92 ASSERT_EQ(0, android_fdsan_close_with_tag(fd, 0xdeadbeef)); in TEST_F()
98 int fd = open("/dev/null", O_RDONLY); in TEST_F() local
99 android_fdsan_exchange_owner_tag(fd, 0, 0xdeadbeef); in TEST_F()
100 EXPECT_FDSAN_DEATH(android_fdsan_close_with_tag(fd, 0xdeadc0de), "expected to be owned"); in TEST_F()
106 int fd = open("/dev/null", O_RDONLY); in TEST_F() local
107 android_fdsan_exchange_owner_tag(fd, 0, 0xdeadbeef); in TEST_F()
108 EXPECT_FDSAN_DEATH(android_fdsan_exchange_owner_tag(fd, 0xbadc0de, 0xdeadbeef), in TEST_F()
133 int fd = open("/dev/null", O_RDONLY); in TEST_F() local
135 android_fdsan_exchange_owner_tag(fd, 0, tag); in TEST_F()
136 fds[fd] = tag; in TEST_F()
139 for (auto [fd, tag] : fds) { in TEST_F()
140 android_fdsan_close_with_tag(fd, tag); in TEST_F()
147 int fd = open("/dev/null", O_RDONLY); in TEST_F() local
149 android_fdsan_exchange_owner_tag(fd, 0, tag); in TEST_F()
150 EXPECT_FDSAN_DEATH(android_fdsan_exchange_owner_tag(fd, 0xbadc0de, 0xdeadbeef), in TEST_F()
157 int fd = open("/dev/null", O_RDONLY); in TEST_F() local
159 android_fdsan_exchange_owner_tag(fd, 0, tag); in TEST_F()
160 EXPECT_FDSAN_DEATH(android_fdsan_exchange_owner_tag(fd, 0xbadc0de, 0xdeadbeef), in TEST_F()
167 android::base::unique_fd fd(open("/dev/null", O_RDONLY)); in TEST_F() local
169 EXPECT_FDSAN_DEATH(close(fd.get()), "expected to be unowned, actually owned by unique_fd"); in TEST_F()
174 android::base::unique_fd fd(open("/dev/null", O_RDONLY)); in TEST_F() local
175 close(fd.release()); in TEST_F()
179 android::base::unique_fd fd(open("/dev/null", O_RDONLY)); in TEST_F() local
180 android::base::unique_fd fd_moved = std::move(fd); in TEST_F()
181 ASSERT_EQ(-1, fd.get()); in TEST_F()
187 android::base::unique_fd fd(open("/dev/null", O_RDONLY)); in TEST_F() local
188 android::base::unique_fd fd_moved = std::move(fd); in TEST_F()
189 ASSERT_EQ(-1, fd.get()); in TEST_F()
198 android::base::unique_fd fd(open("/dev/null", O_RDONLY)); in TEST_F() local
204 close(fd.get()); in TEST_F()