Lines Matching refs:num_callbacks
38 std::shared_ptr<int> num_callbacks(new int{0}); in TEST() local
39 deferred.Bind([num_callbacks](AsyncResult<TestMessage> msg) { in TEST()
45 (*num_callbacks)++; in TEST()
59 ASSERT_EQ(1, *num_callbacks); in TEST()
65 std::shared_ptr<int> num_callbacks(new int{0}); in TEST() local
66 deferred.Bind([num_callbacks](AsyncResult<TestMessage> msg) { in TEST()
71 (*num_callbacks)++; in TEST()
79 ASSERT_EQ(1, *num_callbacks); in TEST()
84 std::shared_ptr<int> num_callbacks(new int{0}); in TEST() local
87 deferred.Bind([num_callbacks](AsyncResult<TestMessage> msg) { in TEST()
89 (*num_callbacks)++; in TEST()
92 ASSERT_EQ(1, *num_callbacks); in TEST()
99 std::shared_ptr<int> num_callbacks(new int{0}); in TEST() local
102 [num_callbacks](AsyncResult<TestMessage>) { (*num_callbacks)++; }); in TEST()
106 ASSERT_GE(num_callbacks.use_count(), 2); in TEST()
111 ASSERT_EQ(1, num_callbacks.use_count()); in TEST()
112 ASSERT_EQ(0, *num_callbacks); in TEST()
115 deferred.Bind([num_callbacks](AsyncResult<TestMessage> msg) { in TEST()
118 (*num_callbacks)++; in TEST()
123 ASSERT_EQ(1, *num_callbacks); in TEST()
124 ASSERT_EQ(1, num_callbacks.use_count()); in TEST()
129 std::shared_ptr<int> num_callbacks(new int{0}); in TEST() local
131 [num_callbacks](AsyncResult<TestMessage> msg) { in TEST()
137 (*num_callbacks)++; in TEST()
155 ASSERT_EQ(0, *num_callbacks); in TEST()
158 ASSERT_EQ(1, *num_callbacks); in TEST()
167 ASSERT_EQ(2, *num_callbacks); in TEST()
171 deferred.Bind([num_callbacks](AsyncResult<TestMessage> msg) { in TEST()
173 (*num_callbacks)++; in TEST()
176 ASSERT_EQ(3, *num_callbacks); in TEST()
178 ASSERT_EQ(1, num_callbacks.use_count()); in TEST()
185 std::shared_ptr<int> num_callbacks(new int{0}); in TEST() local
187 [num_callbacks](AsyncResult<TestMessage> msg) { in TEST()
189 ASSERT_EQ(*num_callbacks == 0 ? 13 : -1, msg.fd()); in TEST()
190 ASSERT_EQ(*num_callbacks, msg->num()); in TEST()
191 ASSERT_EQ(std::to_string(*num_callbacks), msg->str()); in TEST()
193 (*num_callbacks)++; in TEST()
213 ASSERT_EQ(4, *num_callbacks); in TEST()
216 ASSERT_EQ(4, *num_callbacks); in TEST()
218 ASSERT_EQ(1, num_callbacks.use_count()); in TEST()
224 std::shared_ptr<int> num_callbacks(new int{0}); in TEST() local
228 deferred.Bind([num_callbacks](AsyncResult<TestMessage> msg) { in TEST()
229 ASSERT_EQ((*num_callbacks) < 3, msg.success()); in TEST()
231 (*num_callbacks)++; in TEST()
242 ASSERT_EQ(4, *num_callbacks); in TEST()
246 ASSERT_EQ(4, *num_callbacks); in TEST()
247 ASSERT_EQ(1, num_callbacks.use_count()); in TEST()
254 std::shared_ptr<int> num_callbacks(new int{0}); in TEST() local
255 deferred.Bind([num_callbacks](AsyncResult<TestMessage> msg) { in TEST()
260 (*num_callbacks)++; in TEST()
278 ASSERT_EQ(1, *num_callbacks); in TEST()