Home | History | Annotate | Download | only in test

Lines Matching refs:found

3 // found in the LICENSE file.
79 TraceEventVector found;
80 analyzer->FindEvents(Query::Bool(true), &found);
81 EXPECT_EQ(0u, found.size());
231 TraceEventVector found;
235 analyzer->FindEvents(Query::EventCategory() == Query::String("cat1"), &found);
236 ASSERT_EQ(2u, found.size());
237 EXPECT_STREQ("name1", found[0]->name.c_str());
238 EXPECT_STREQ("name2", found[1]->name.c_str());
240 analyzer->FindEvents(Query::EventArg("num") == Query::Int(2), &found);
241 ASSERT_EQ(1u, found.size());
242 EXPECT_STREQ("name2", found[0]->name.c_str());
246 analyzer->FindEvents(Query::EventCategory() != Query::String("cat1"), &found);
247 ASSERT_EQ(2u, found.size());
248 EXPECT_STREQ("name3", found[0]->name.c_str());
249 EXPECT_STREQ("name4", found[1]->name.c_str());
251 analyzer->FindEvents(Query::EventArg("num") != Query::Int(2), &found);
252 ASSERT_EQ(3u, found.size());
253 EXPECT_STREQ("name1", found[0]->name.c_str());
254 EXPECT_STREQ("name3", found[1]->name.c_str());
255 EXPECT_STREQ("name4", found[2]->name.c_str());
258 analyzer->FindEvents(Query::EventArg("num") < Query::Int(2), &found);
259 ASSERT_EQ(1u, found.size());
260 EXPECT_STREQ("name1", found[0]->name.c_str());
263 analyzer->FindEvents(Query::EventArg("num") <= Query::Int(2), &found);
264 ASSERT_EQ(2u, found.size());
265 EXPECT_STREQ("name1", found[0]->name.c_str());
266 EXPECT_STREQ("name2", found[1]->name.c_str());
269 analyzer->FindEvents(Query::EventArg("num") > Query::Int(3), &found);
270 ASSERT_EQ(1u, found.size());
271 EXPECT_STREQ("name4", found[0]->name.c_str());
274 analyzer->FindEvents(Query::EventArg("num") >= Query::Int(4), &found);
275 ASSERT_EQ(1u, found.size());
276 EXPECT_STREQ("name4", found[0]->name.c_str());
280 Query::EventArg("num") < Query::Int(3), &found);
281 ASSERT_EQ(1u, found.size());
282 EXPECT_STREQ("name2", found[0]->name.c_str());
286 Query::EventArg("num") == Query::Int(3), &found);
287 ASSERT_EQ(2u, found.size());
288 EXPECT_STREQ("name1", found[0]->name.c_str());
289 EXPECT_STREQ("name3", found[1]->name.c_str());
293 Query::EventArg("num") == Query::Int(3)), &found);
294 ASSERT_EQ(2u, found.size());
295 EXPECT_STREQ("name2", found[0]->name.c_str());
296 EXPECT_STREQ("name4", found[1]->name.c_str());
321 TraceEventVector found;
327 Query::Int(20), &found);
328 EXPECT_EQ(1u, found.size());
329 EXPECT_STREQ("math2", found.front()->name.c_str());
333 Query::Int(5), &found);
334 EXPECT_EQ(1u, found.size());
335 EXPECT_STREQ("math1", found.front()->name.c_str());
339 Query::Int(50), &found);
340 EXPECT_EQ(1u, found.size());
341 EXPECT_STREQ("math1", found.front()->name.c_str());
345 Query::Int(2), &found);
346 EXPECT_EQ(1u, found.size());
347 EXPECT_STREQ("math1", found.front()->name.c_str());
351 Query::Int(0), &found);
352 EXPECT_EQ(2u, found.size());
355 analyzer->FindEvents(-Query::EventArg("b") == Query::Int(-10), &found);
356 EXPECT_EQ(1u, found.size());
357 EXPECT_STREQ("math2", found.front()->name.c_str());
377 TraceEventVector found;
379 analyzer->FindEvents(Query::EventName() == Query::Pattern("name?"), &found);
380 ASSERT_EQ(2u, found.size());
381 EXPECT_STREQ("name1", found[0]->name.c_str());
382 EXPECT_STREQ("name2", found[1]->name.c_str());
384 analyzer->FindEvents(Query::EventName() == Query::Pattern("name*"), &found);
385 ASSERT_EQ(3u, found.size());
386 EXPECT_STREQ("name1", found[0]->name.c_str());
387 EXPECT_STREQ("name2", found[1]->name.c_str());
388 EXPECT_STREQ("name3x", found[2]->name.c_str());
390 analyzer->FindEvents(Query::EventName() != Query::Pattern("name*"), &found);
391 ASSERT_EQ(1u, found.size());
392 EXPECT_STREQ("no match", found[0]->name.c_str());
406 TRACE_EVENT_BEGIN0("cat1", "name1"); // found by duration query
409 TRACE_EVENT_BEGIN0("cat2", "name3"); // found by duration query
413 TRACE_EVENT_BEGIN0("cat2", "name5"); // not found (duration too short)
414 TRACE_EVENT_END0("cat2", "name5"); // not found (duration too short)
415 TRACE_EVENT_END0("cat2", "name3"); // found by duration query
418 TRACE_EVENT_END0("cat1", "name1"); // found by duration query
427 TraceEventVector found;
434 &found);
435 ASSERT_EQ(2u, found.size());
436 EXPECT_STREQ("name1", found[0]->name.c_str());
437 EXPECT_STREQ("name3", found[1]->name.c_str());
451 TRACE_EVENT0("cat1", "name1"); // found by duration query
454 TRACE_EVENT0("cat2", "name3"); // found by duration query
458 TRACE_EVENT0("cat2", "name5"); // not found (duration too short)
468 TraceEventVector found;
474 &found);
475 ASSERT_EQ(2u, found.size());
476 EXPECT_STREQ("name1", found[0]->name.c_str());
477 EXPECT_STREQ("name3", found[1]->name.c_str());
499 TraceEventVector found;
500 analyzer->FindEvents(Query::MatchBeginWithEnd(), &found);
501 ASSERT_EQ(1u, found.size());
502 EXPECT_STREQ("name2", found[0]->name.c_str());
522 TraceEventVector found;
523 analyzer->FindEvents(Query::MatchBeginName("name1"), &found);
524 ASSERT_EQ(1u, found.size());
526 EXPECT_FALSE(found[0]->GetArgAsString("arg", &arg_actual));
529 EXPECT_TRUE(found[0]->GetArgAsString("arg", &arg_actual));
555 TraceEventVector found;
556 analyzer->FindEvents(Query::MatchAsyncBeginWithNext(), &found);
557 ASSERT_EQ(2u, found.size());
558 EXPECT_STRCASEEQ("0xb", found[0]->id.c_str());
559 EXPECT_STRCASEEQ("0xc", found[1]->id.c_str());
587 TraceEventVector found;
588 analyzer->FindEvents(Query::MatchAsyncBeginWithNext(), &found);
589 ASSERT_EQ(3u, found.size());
591 EXPECT_STRCASEEQ("0xb", found[0]->id.c_str());
592 EXPECT_EQ(TRACE_EVENT_PHASE_ASYNC_STEP_PAST, found[0]->other_event->phase);
593 EXPECT_TRUE(found[0]->other_event->other_event);
595 found[0]->other_event->other_event->phase);
597 EXPECT_STRCASEEQ("0xc", found[1]->id.c_str());
598 EXPECT_EQ(TRACE_EVENT_PHASE_ASYNC_STEP_INTO, found[1]->other_event->phase);
599 EXPECT_TRUE(found[1]->other_event->other_event);
601 found[1]->other_event->other_event->phase);
603 EXPECT_TRUE(found[1]->other_event->other_event->GetArgAsNumber(
606 EXPECT_TRUE(found[1]->other_event->other_event->other_event);
608 found[1]->other_event->other_event->other_event->phase);
610 EXPECT_STRCASEEQ("0xa", found[2]->id.c_str());
611 EXPECT_EQ(TRACE_EVENT_PHASE_ASYNC_STEP_INTO, found[2]->other_event->phase);
645 TraceEventVector found;
649 Query::EventHasOther(), &found);
650 EXPECT_EQ(0u, found.size());
654 !Query::EventHasOther(), &found);
655 EXPECT_EQ(1u, found.size());
659 !Query::EventHasOther(), &found);
660 EXPECT_EQ(1u, found.size());
664 Query::OtherCategory() == Query::String("cat4"), &found);
665 EXPECT_EQ(1u, found.size());
669 Query::OtherCategory() == Query::String("cat2"), &found);
670 EXPECT_EQ(0u, found.size());
674 Query::OtherCategory() == Query::String("cat5"), &found);
675 EXPECT_EQ(1u, found.size());
679 Query::OtherCategory() == Query::String("cat3"), &found);
680 EXPECT_EQ(0u, found.size());
847 // Only one event matches query_one, so two closest can't be found.