Home | History | Annotate | Download | only in tests

Lines Matching defs:Counter

262 struct Counter {
276 Counter(void (*fn)(sigval_t)) : value(0), timer_valid(false) {
289 ~Counter() {
312 Counter* cd = reinterpret_cast<Counter*>(value.sival_ptr);
317 Counter* cd = reinterpret_cast<Counter*>(value.sival_ptr);
326 Counter counter(Counter::CountAndDisarmNotifyFunction);
327 ASSERT_EQ(0, counter.Value());
329 counter.SetTime(0, 500000000, 1, 0);
333 ASSERT_EQ(1, counter.Value());
337 Counter counter(Counter::CountNotifyFunction);
338 ASSERT_EQ(0, counter.Value());
340 counter.SetTime(0, 1, 0, 10);
341 ASSERT_TRUE(counter.ValueUpdated());
342 ASSERT_TRUE(counter.ValueUpdated());
343 ASSERT_TRUE(counter.ValueUpdated());
344 counter.DeleteTimer();
406 Counter counter1(Counter::CountNotifyFunction);
407 Counter counter2(Counter::CountNotifyFunction);
408 Counter counter3(Counter::CountNotifyFunction);
424 Counter counter(Counter::CountNotifyFunction);
425 ASSERT_EQ(0, counter.Value());
427 counter.SetTime(0, 1, 0, 1);
428 ASSERT_TRUE(counter.ValueUpdated());
429 ASSERT_TRUE(counter.ValueUpdated());
430 ASSERT_TRUE(counter.ValueUpdated());
432 counter.SetTime(0, 0, 0, 0);
435 int value = counter.Value();
438 // Verify the counter has not been incremented.
439 ASSERT_EQ(value, counter.Value());
444 Counter counter(Counter::CountNotifyFunction);
445 ASSERT_EQ(0, counter.Value());
447 counter.SetTime(0, 1, 0, 1);
448 ASSERT_TRUE(counter.ValueUpdated());
449 ASSERT_TRUE(counter.ValueUpdated());
450 ASSERT_TRUE(counter.ValueUpdated());
452 counter.DeleteTimer();
455 int value = counter.Value();
458 // Verify the counter has not been incremented.
459 ASSERT_EQ(value, counter.Value());