Home | History | Annotate | Download | only in test

Lines Matching refs:found

3 // found in the LICENSE file.
88 TraceEventVector found;
89 analyzer->FindEvents(Query::Bool(true), &found);
90 EXPECT_EQ(0u, found.size());
247 TraceEventVector found;
251 analyzer->FindEvents(Query::EventCategory() == Query::String("cat1"), &found);
252 ASSERT_EQ(2u, found.size());
253 EXPECT_STREQ("name1", found[0]->name.c_str());
254 EXPECT_STREQ("name2", found[1]->name.c_str());
256 analyzer->FindEvents(Query::EventArg("num") == Query::Int(2), &found);
257 ASSERT_EQ(1u, found.size());
258 EXPECT_STREQ("name2", found[0]->name.c_str());
262 analyzer->FindEvents(Query::EventCategory() != Query::String("cat1"), &found);
263 ASSERT_EQ(2u, found.size());
264 EXPECT_STREQ("name3", found[0]->name.c_str());
265 EXPECT_STREQ("name4", found[1]->name.c_str());
267 analyzer->FindEvents(Query::EventArg("num") != Query::Int(2), &found);
268 ASSERT_EQ(3u, found.size());
269 EXPECT_STREQ("name1", found[0]->name.c_str());
270 EXPECT_STREQ("name3", found[1]->name.c_str());
271 EXPECT_STREQ("name4", found[2]->name.c_str());
274 analyzer->FindEvents(Query::EventArg("num") < Query::Int(2), &found);
275 ASSERT_EQ(1u, found.size());
276 EXPECT_STREQ("name1", found[0]->name.c_str());
279 analyzer->FindEvents(Query::EventArg("num") <= Query::Int(2), &found);
280 ASSERT_EQ(2u, found.size());
281 EXPECT_STREQ("name1", found[0]->name.c_str());
282 EXPECT_STREQ("name2", found[1]->name.c_str());
285 analyzer->FindEvents(Query::EventArg("num") > Query::Int(3), &found);
286 ASSERT_EQ(1u, found.size());
287 EXPECT_STREQ("name4", found[0]->name.c_str());
290 analyzer->FindEvents(Query::EventArg("num") >= Query::Int(4), &found);
291 ASSERT_EQ(1u, found.size());
292 EXPECT_STREQ("name4", found[0]->name.c_str());
296 Query::EventArg("num") < Query::Int(3), &found);
297 ASSERT_EQ(1u, found.size());
298 EXPECT_STREQ("name2", found[0]->name.c_str());
302 Query::EventArg("num") == Query::Int(3), &found);
303 ASSERT_EQ(2u, found.size());
304 EXPECT_STREQ("name1", found[0]->name.c_str());
305 EXPECT_STREQ("name3", found[1]->name.c_str());
309 Query::EventArg("num") == Query::Int(3)), &found);
310 ASSERT_EQ(2u, found.size());
311 EXPECT_STREQ("name2", found[0]->name.c_str());
312 EXPECT_STREQ("name4", found[1]->name.c_str());
337 TraceEventVector found;
343 Query::Int(20), &found);
344 EXPECT_EQ(1u, found.size());
345 EXPECT_STREQ("math2", found.front()->name.c_str());
349 Query::Int(5), &found);
350 EXPECT_EQ(1u, found.size());
351 EXPECT_STREQ("math1", found.front()->name.c_str());
355 Query::Int(50), &found);
356 EXPECT_EQ(1u, found.size());
357 EXPECT_STREQ("math1", found.front()->name.c_str());
361 Query::Int(2), &found);
362 EXPECT_EQ(1u, found.size());
363 EXPECT_STREQ("math1", found.front()->name.c_str());
367 Query::Int(0), &found);
368 EXPECT_EQ(2u, found.size());
371 analyzer->FindEvents(-Query::EventArg("b") == Query::Int(-10), &found);
372 EXPECT_EQ(1u, found.size());
373 EXPECT_STREQ("math2", found.front()->name.c_str());
393 TraceEventVector found;
395 analyzer->FindEvents(Query::EventName() == Query::Pattern("name?"), &found);
396 ASSERT_EQ(2u, found.size());
397 EXPECT_STREQ("name1", found[0]->name.c_str());
398 EXPECT_STREQ("name2", found[1]->name.c_str());
400 analyzer->FindEvents(Query::EventName() == Query::Pattern("name*"), &found);
401 ASSERT_EQ(3u, found.size());
402 EXPECT_STREQ("name1", found[0]->name.c_str());
403 EXPECT_STREQ("name2", found[1]->name.c_str());
404 EXPECT_STREQ("name3x", found[2]->name.c_str());
406 analyzer->FindEvents(Query::EventName() != Query::Pattern("name*"), &found);
407 ASSERT_EQ(1u, found.size());
408 EXPECT_STREQ("no match", found[0]->name.c_str());
422 TRACE_EVENT_BEGIN0("cat1", "name1"); // found by duration query
425 TRACE_EVENT_BEGIN0("cat2", "name3"); // found by duration query
429 TRACE_EVENT_BEGIN0("cat2", "name5"); // not found (duration too short)
430 TRACE_EVENT_END0("cat2", "name5"); // not found (duration too short)
431 TRACE_EVENT_END0("cat2", "name3"); // found by duration query
434 TRACE_EVENT_END0("cat1", "name1"); // found by duration query
443 TraceEventVector found;
451 &found);
452 ASSERT_EQ(2u, found.size());
453 EXPECT_STREQ("name1", found[0]->name.c_str());
454 EXPECT_STREQ("name3", found[1]->name.c_str());
468 TRACE_EVENT0("cat1", "name1"); // found by duration query
471 TRACE_EVENT0("cat2", "name3"); // found by duration query
475 TRACE_EVENT0("cat2", "name5"); // not found (duration too short)
485 TraceEventVector found;
492 &found);
493 ASSERT_EQ(2u, found.size());
494 EXPECT_STREQ("name1", found[0]->name.c_str());
495 EXPECT_STREQ("name3", found[1]->name.c_str());
517 TraceEventVector found;
518 analyzer->FindEvents(Query::MatchBeginWithEnd(), &found);
519 ASSERT_EQ(1u, found.size());
520 EXPECT_STREQ("name2", found[0]->name.c_str());
540 TraceEventVector found;
541 analyzer->FindEvents(Query::MatchBeginName("name1"), &found);
542 ASSERT_EQ(1u, found.size());
544 EXPECT_FALSE(found[0]->GetArgAsString("arg", &arg_actual));
547 EXPECT_TRUE(found[0]->GetArgAsString("arg", &arg_actual));
573 TraceEventVector found;
574 analyzer->FindEvents(Query::MatchAsyncBeginWithNext(), &found);
575 ASSERT_EQ(2u, found.size());
576 EXPECT_STRCASEEQ("0xb", found[0]->id.c_str());
577 EXPECT_STRCASEEQ("0xc", found[1]->id.c_str());
605 TraceEventVector found;
606 analyzer->FindEvents(Query::MatchAsyncBeginWithNext(), &found);
607 ASSERT_EQ(3u, found.size());
609 EXPECT_STRCASEEQ("0xb", found[0]->id.c_str());
610 EXPECT_EQ(TRACE_EVENT_PHASE_ASYNC_STEP_PAST, found[0]->other_event->phase);
611 EXPECT_EQ(found[0], found[0]->other_event->prev_event);
612 EXPECT_TRUE(found[0]->other_event->other_event);
614 found[0]->other_event->other_event->phase);
615 EXPECT_EQ(found[0]->other_event,
616 found[0]->other_event->other_event->prev_event);
618 EXPECT_STRCASEEQ("0xc", found[1]->id.c_str());
619 EXPECT_EQ(TRACE_EVENT_PHASE_ASYNC_STEP_INTO, found[1]->other_event->phase);
620 EXPECT_EQ(found[1], found[1]->other_event->prev_event);
621 EXPECT_TRUE(found[1]->other_event->other_event);
623 found[1]->other_event->other_event->phase);
624 EXPECT_EQ(found[1]->other_event,
625 found[1]->other_event->other_event->prev_event);
627 EXPECT_TRUE(found[1]->other_event->other_event->GetArgAsNumber(
630 EXPECT_TRUE(found[1]->other_event->other_event->other_event);
632 found[1]->other_event->other_event->other_event->phase);
634 EXPECT_STRCASEEQ("0xa", found[2]->id.c_str());
635 EXPECT_EQ(TRACE_EVENT_PHASE_ASYNC_STEP_INTO, found[2]->other_event->phase);
669 TraceEventVector found;
673 Query::EventHasOther(), &found);
674 EXPECT_EQ(0u, found.size());
678 !Query::EventHasOther(), &found);
679 EXPECT_EQ(1u, found.size());
683 !Query::EventHasOther(), &found);
684 EXPECT_EQ(1u, found.size());
688 Query::OtherCategory() == Query::String("cat4"), &found);
689 EXPECT_EQ(1u, found.size());
693 Query::OtherCategory() == Query::String("cat2"), &found);
694 EXPECT_EQ(0u, found.size());
698 Query::OtherCategory() == Query::String("cat5"), &found);
699 EXPECT_EQ(1u, found.size());
703 Query::OtherCategory() == Query::String("cat3"), &found);
704 EXPECT_EQ(0u, found.size());
883 // Only one event matches query_one, so two closest can't be found.