Home | History | Annotate | Download | only in tests

Lines Matching refs:Counter

365 struct Counter {
379 explicit Counter(void (*fn)(sigval_t)) : value(0), timer_valid(false) {
392 ~Counter() {
415 Counter* cd = reinterpret_cast<Counter*>(value.sival_ptr);
420 Counter* cd = reinterpret_cast<Counter*>(value.sival_ptr);
429 Counter counter(Counter::CountAndDisarmNotifyFunction);
430 ASSERT_EQ(0, counter.Value());
432 counter.SetTime(0, 500000000, 1, 0);
436 ASSERT_EQ(1, counter.Value());
440 Counter counter(Counter::CountNotifyFunction);
441 ASSERT_EQ(0, counter.Value());
443 counter.SetTime(0, 1, 0, 10);
444 ASSERT_TRUE(counter.ValueUpdated());
445 ASSERT_TRUE(counter.ValueUpdated());
446 ASSERT_TRUE(counter.ValueUpdated());
447 counter.DeleteTimer();
509 Counter counter1(Counter::CountNotifyFunction);
510 Counter counter2(Counter::CountNotifyFunction);
511 Counter counter3(Counter::CountNotifyFunction);
527 Counter counter(Counter::CountNotifyFunction);
528 ASSERT_EQ(0, counter.Value());
530 counter.SetTime(0, 1, 0, 1);
531 ASSERT_TRUE(counter.ValueUpdated());
532 ASSERT_TRUE(counter.ValueUpdated());
533 ASSERT_TRUE(counter.ValueUpdated());
535 counter.SetTime(0, 0, 0, 0);
538 int value = counter.Value();
541 // Verify the counter has not been incremented.
542 ASSERT_EQ(value, counter.Value());
547 Counter counter(Counter::CountNotifyFunction);
548 ASSERT_EQ(0, counter.Value());
550 counter.SetTime(0, 1, 0, 1);
551 ASSERT_TRUE(counter.ValueUpdated());
552 ASSERT_TRUE(counter.ValueUpdated());
553 ASSERT_TRUE(counter.ValueUpdated());
555 counter.DeleteTimer();
558 int value = counter.Value();
561 // Verify the counter has not been incremented.
562 ASSERT_EQ(value, counter.Value());