Home | History | Annotate | Download | only in tests

Lines Matching refs:Counter

310 struct Counter {
324 explicit Counter(void (*fn)(sigval_t)) : value(0), timer_valid(false) {
337 ~Counter() {
360 Counter* cd = reinterpret_cast<Counter*>(value.sival_ptr);
365 Counter* cd = reinterpret_cast<Counter*>(value.sival_ptr);
374 Counter counter(Counter::CountAndDisarmNotifyFunction);
375 ASSERT_EQ(0, counter.Value());
377 counter.SetTime(0, 500000000, 1, 0);
381 ASSERT_EQ(1, counter.Value());
385 Counter counter(Counter::CountNotifyFunction);
386 ASSERT_EQ(0, counter.Value());
388 counter.SetTime(0, 1, 0, 10);
389 ASSERT_TRUE(counter.ValueUpdated());
390 ASSERT_TRUE(counter.ValueUpdated());
391 ASSERT_TRUE(counter.ValueUpdated());
392 counter.DeleteTimer();
454 Counter counter1(Counter::CountNotifyFunction);
455 Counter counter2(Counter::CountNotifyFunction);
456 Counter counter3(Counter::CountNotifyFunction);
472 Counter counter(Counter::CountNotifyFunction);
473 ASSERT_EQ(0, counter.Value());
475 counter.SetTime(0, 1, 0, 1);
476 ASSERT_TRUE(counter.ValueUpdated());
477 ASSERT_TRUE(counter.ValueUpdated());
478 ASSERT_TRUE(counter.ValueUpdated());
480 counter.SetTime(0, 0, 0, 0);
483 int value = counter.Value();
486 // Verify the counter has not been incremented.
487 ASSERT_EQ(value, counter.Value());
492 Counter counter(Counter::CountNotifyFunction);
493 ASSERT_EQ(0, counter.Value());
495 counter.SetTime(0, 1, 0, 1);
496 ASSERT_TRUE(counter.ValueUpdated());
497 ASSERT_TRUE(counter.ValueUpdated());
498 ASSERT_TRUE(counter.ValueUpdated());
500 counter.DeleteTimer();
503 int value = counter.Value();
506 // Verify the counter has not been incremented.
507 ASSERT_EQ(value, counter.Value());