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

Function testParentService

lib/cpp/test/processor/ProcessorTest.cpp:427–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425
426template <typename State_>
427void testParentService(const std::shared_ptr<State_>& state) {
428 std::shared_ptr<typename State_::Client> client = state->createClient();
429
430 int32_t gen = client->getGeneration();
431 int32_t newGen = client->incrementGeneration();
432 BOOST_CHECK_EQUAL(gen + 1, newGen);
433 newGen = client->getGeneration();
434 BOOST_CHECK_EQUAL(gen + 1, newGen);
435
436 client->addString("foo");
437 client->addString("bar");
438 client->addString("asdf");
439
440 vector<string> strings;
441 client->getStrings(strings);
442 BOOST_REQUIRE_EQUAL(3, strings.size());
443 BOOST_REQUIRE_EQUAL("foo", strings[0]);
444 BOOST_REQUIRE_EQUAL("bar", strings[1]);
445 BOOST_REQUIRE_EQUAL("asdf", strings[2]);
446}
447
448template <typename State_>
449void testChildService(const std::shared_ptr<State_>& state) {

Callers 2

testBasicServiceFunction · 0.85
testInheritedServiceFunction · 0.85

Calls 6

createClientMethod · 0.45
getGenerationMethod · 0.45
incrementGenerationMethod · 0.45
addStringMethod · 0.45
getStringsMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected