Lines Matching refs:pfd

129     adb_pollfd pfd[2] = {};  in TEST_F()  local
130 pfd[0].fd = fds[0]; in TEST_F()
131 pfd[0].events = POLLRDNORM; in TEST_F()
132 pfd[1].fd = fds[1]; in TEST_F()
133 pfd[1].events = POLLWRNORM; in TEST_F()
135 pfd[0].revents = -1; in TEST_F()
136 pfd[1].revents = -1; in TEST_F()
137 EXPECT_EQ(1, adb_poll(pfd, 2, 0)); in TEST_F()
138 EXPECT_EQ(0, pfd[0].revents); in TEST_F()
139 EXPECT_EQ(POLLWRNORM, pfd[1].revents); in TEST_F()
144 pfd[0].revents = -1; in TEST_F()
145 EXPECT_EQ(1, adb_poll(pfd, 1, 100)); in TEST_F()
146 EXPECT_EQ(POLLRDNORM, pfd[0].revents); in TEST_F()
147 pfd[0].revents = -1; in TEST_F()
148 pfd[1].revents = -1; in TEST_F()
149 EXPECT_EQ(2, adb_poll(pfd, 2, 0)); in TEST_F()
150 EXPECT_EQ(POLLRDNORM, pfd[0].revents); in TEST_F()
151 EXPECT_EQ(POLLWRNORM, pfd[1].revents); in TEST_F()
155 adb_pollfd pfd = {}; in TEST_F() local
156 pfd.fd = fds[0]; in TEST_F()
157 pfd.events = POLLRDNORM; in TEST_F()
159 EXPECT_EQ(0, adb_poll(&pfd, 1, 100)); in TEST_F()
160 EXPECT_EQ(0, pfd.revents); in TEST_F()
164 EXPECT_EQ(1, adb_poll(&pfd, 1, 100)); in TEST_F()
165 EXPECT_EQ(POLLRDNORM, pfd.revents); in TEST_F()
169 adb_pollfd pfd[3] = {}; in TEST_F() local
170 pfd[0].fd = fds[0]; in TEST_F()
171 pfd[0].events = POLLRDNORM; in TEST_F()
172 pfd[1].fd = INT_MAX; in TEST_F()
173 pfd[1].events = POLLRDNORM; in TEST_F()
174 pfd[2].fd = fds[1]; in TEST_F()
175 pfd[2].events = POLLWRNORM; in TEST_F()
180 EXPECT_EQ(1, adb_poll(pfd, 1, 100)); in TEST_F()
181 EXPECT_EQ(POLLRDNORM, pfd[0].revents); in TEST_F()
183 EXPECT_EQ(3, adb_poll(pfd, 3, 0)); in TEST_F()
184 EXPECT_EQ(POLLRDNORM, pfd[0].revents); in TEST_F()
185 EXPECT_EQ(POLLNVAL, pfd[1].revents); in TEST_F()
186 EXPECT_EQ(POLLWRNORM, pfd[2].revents); in TEST_F()
190 adb_pollfd pfd[2] = {}; in TEST_F() local
191 pfd[0].fd = fds[0]; in TEST_F()
192 pfd[0].events = POLLRDNORM; in TEST_F()
193 pfd[1] = pfd[0]; in TEST_F()
195 EXPECT_EQ(0, adb_poll(pfd, 2, 0)); in TEST_F()
196 EXPECT_EQ(0, pfd[0].revents); in TEST_F()
197 EXPECT_EQ(0, pfd[1].revents); in TEST_F()
201 EXPECT_EQ(2, adb_poll(pfd, 2, 100)); in TEST_F()
202 EXPECT_EQ(POLLRDNORM, pfd[0].revents); in TEST_F()
203 EXPECT_EQ(POLLRDNORM, pfd[1].revents); in TEST_F()
207 adb_pollfd pfd = {}; in TEST_F() local
208 pfd.fd = fds[0]; in TEST_F()
209 pfd.events = POLLIN; in TEST_F()
211 EXPECT_EQ(0, adb_poll(&pfd, 1, 0)); in TEST_F()
212 EXPECT_EQ(0, pfd.revents); in TEST_F()
217 EXPECT_EQ(1, adb_poll(&pfd, 1, 100)); in TEST_F()
220 EXPECT_EQ(POLLHUP, pfd.revents & POLLHUP); in TEST_F()
232 adb_pollfd pfd; in TEST_F() local
233 pfd.events = POLLIN; in TEST_F()
234 pfd.fd = sockets[i * 2 + 1]; in TEST_F()
235 pfds.push_back(pfd); in TEST_F()