MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / main

Function main

test/common/unit_test_serial_client.cpp:67–100  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// Set up global fixture ///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

65// Set up global fixture
66////////////////////////////////////////////////////////////////////////////////
67int main(int argc, char **argv)
68{
69 ::testing::InitGoogleTest(&argc, argv);
70
71 ::testing::TestEventListeners &listeners = ::testing::UnitTest::GetInstance()->listeners();
72 listeners.Append(new LeakChecker);
73
74 // create logger instance
75 StdoutLogger *m_logger = new StdoutLogger();
76 m_logger->setFilterLevel(Logger::log_level_t::kInfo);
77 Log::setLogger(m_logger);
78 Log::info("Starting ERPC client on port '%s' with baud %d.\n", UNIT_TEST_SERIAL_PORT, UNIT_TEST_SERIAL_BAUD);
79
80 g_client = new ClientManager();
81 uint8_t vtime = 0;
82 uint8_t vmin = 1;
83 while (kErpcStatus_Success != g_transport.init(vtime, vmin))
84 ;
85
86 g_transport.setCrc16(&g_crc16);
87 g_client->setMessageBufferFactory(&g_msgFactory);
88 g_client->setTransport(&g_transport);
89 g_client->setCodecFactory(&g_basicCodecFactory);
90 erpc_client_t client = reinterpret_cast<erpc_client_t>(g_client);
91 initInterfaces_common(client);
92 initInterfaces(client);
93
94 int ret = RUN_ALL_TESTS();
95 quit();
96 free(m_logger);
97 free(g_client);
98
99 return ret;
100}
101
102void initInterfaces_common(erpc_client_t client)
103{

Callers

nothing calls this directly

Calls 10

InitGoogleTestFunction · 0.85
RUN_ALL_TESTSFunction · 0.85
AppendMethod · 0.80
setFilterLevelMethod · 0.80
setTransportMethod · 0.80
initInterfaces_commonFunction · 0.70
quitFunction · 0.70
initInterfacesFunction · 0.50
initMethod · 0.45
setCrc16Method · 0.45

Tested by

no test coverage detected