Lines Matching refs:events

50 void DumpEvent(std::vector<android_fdtrack_event>* events, size_t index) {  in DumpEvent()  argument
51 auto& event = (*events)[index]; in DumpEvent()
69 static std::vector<android_fdtrack_event> events; in FdtrackRun() local
70 events.clear(); in FdtrackRun()
73 android_fdtrack_hook_t hook = [](android_fdtrack_event* event) { events.push_back(*event); }; in FdtrackRun()
93 while (i + 1 < events.size()) { in FdtrackRun()
94 auto& event = events[i]; in FdtrackRun()
96 for (size_t j = i + 1; j < events.size(); ++j) { in FdtrackRun()
97 if (event.fd == events[j].fd) { in FdtrackRun()
98 if (events[j].type == ANDROID_FDTRACK_EVENT_TYPE_CREATE) { in FdtrackRun()
100 DumpEvent(&events, i); in FdtrackRun()
101 DumpEvent(&events, j); in FdtrackRun()
105 events.erase(events.begin() + j); in FdtrackRun()
106 events.erase(events.begin() + i); in FdtrackRun()
114 return std::move(events); in FdtrackRun()
132 auto events = FdtrackRun([]() { close(fd); }); in TEST() local
133 ASSERT_EQ(1U, events.size()); in TEST()
134 ASSERT_EQ(fd, events[0].fd); in TEST()
135 ASSERT_EQ(ANDROID_FDTRACK_EVENT_TYPE_CLOSE, events[0].type); in TEST()
146 auto events = FdtrackRun([]() { close(fd); }, false); in TEST() local
147 ASSERT_EQ(0U, events.size()); in TEST()
160 auto events = FdtrackRun([]() { in TEST() local
175 ASSERT_EQ(2U, events.size()); in TEST()
177 ASSERT_EQ(fd1, events[0].fd); in TEST()
178 ASSERT_EQ(ANDROID_FDTRACK_EVENT_TYPE_CREATE, events[0].type); in TEST()
179 ASSERT_STREQ("open", events[0].data.create.function_name); in TEST()
181 ASSERT_EQ(fd3, events[1].fd); in TEST()
182 ASSERT_EQ(ANDROID_FDTRACK_EVENT_TYPE_CREATE, events[1].type); in TEST()
183 ASSERT_STREQ("open", events[1].data.create.function_name); in TEST()
201 auto events = FdtrackRun([]() { SetFdResult(&expected_fds, expression); }); \
205 if (events.size() != expected_fds.size()) { \
207 events.size()); \
208 for (size_t i = 0; i < events.size(); ++i) { \
209 DumpEvent(&events, i); \
214 for (auto& event : events) { \
216 std::find(expected_fds.begin(), expected_fds.end(), events[0].fd)); \