MCPcopy Create free account
hub / github.com/apache/brpc / TEST_F

Function TEST_F

test/synchronous_event_unittest.cpp:56–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54
55
56TEST_F(SynchronousEventTest, sanity) {
57 const size_t N = 10;
58 FooObserver foo_observer;
59 FooObserver foo_observer2;
60 foo_observer.another_ob = &foo_observer2;
61 foo_event.subscribe(&foo_observer);
62 int v = 0;
63 result.clear();
64 for (size_t i = 0; i < N; ++i) {
65 foo_event.notify(i, &v);
66 }
67 ASSERT_EQ(2*N, result.size());
68 for (size_t i = 0; i < 2*N; ++i) {
69 ASSERT_EQ((int)i/2, result[i].first);
70 ASSERT_EQ((int)i+1, result[i].second);
71 }
72}
73
74}

Callers

nothing calls this directly

Calls 4

subscribeMethod · 0.80
clearMethod · 0.45
notifyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected