MCPcopy Create free account
hub / github.com/apache/thrift / checkCallPostHandlerEvents

Function checkCallPostHandlerEvents

lib/cpp/test/processor/ProcessorTest.cpp:372–402  ·  view source on GitHub ↗

* Check for the events that should be after a handler returns. */

Source from the content-addressed store, hash-verified

370 * Check for the events that should be after a handler returns.
371 */
372void checkCallPostHandlerEvents(const std::shared_ptr<EventLog>& log,
373 uint32_t connId,
374 uint32_t callId,
375 const string& callName) {
376 // Pre-write
377 Event event = log->waitForEvent();
378 BOOST_CHECK_EQUAL(EventLog::ET_PRE_WRITE, event.type);
379 BOOST_CHECK_EQUAL(connId, event.connectionId);
380 BOOST_CHECK_EQUAL(callId, event.callId);
381 BOOST_CHECK_EQUAL(callName, event.message);
382
383 // Post-write
384 event = log->waitForEvent();
385 BOOST_CHECK_EQUAL(EventLog::ET_POST_WRITE, event.type);
386 BOOST_CHECK_EQUAL(connId, event.connectionId);
387 BOOST_CHECK_EQUAL(callId, event.callId);
388 BOOST_CHECK_EQUAL(callName, event.message);
389
390 // Call finished
391 event = log->waitForEvent();
392 BOOST_CHECK_EQUAL(EventLog::ET_CALL_FINISHED, event.type);
393 BOOST_CHECK_EQUAL(connId, event.connectionId);
394 BOOST_CHECK_EQUAL(callId, event.callId);
395 BOOST_CHECK_EQUAL(callName, event.message);
396
397 // It is acceptable for servers to call processContext() again immediately
398 // to start waiting on the next request. However, some servers wait before
399 // getting either a partial request or the full request before calling
400 // processContext(). We don't check for the next call to processContext()
401 // yet.
402}
403
404/**
405 * Check for the events that should be logged when a call is made.

Callers 2

checkCallEventsFunction · 0.85
testExpectedErrorFunction · 0.85

Calls 1

waitForEventMethod · 0.45

Tested by

no test coverage detected