MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dummy_register

Function dummy_register

dpdk/app/test/test_service_cores.c:139–165  ·  view source on GitHub ↗

register a single dummy service */

Source from the content-addressed store, hash-verified

137
138/* register a single dummy service */
139static int
140dummy_register(void)
141{
142 /* make sure there are no remains from previous tests */
143 unregister_all();
144
145 struct rte_service_spec service;
146 memset(&service, 0, sizeof(struct rte_service_spec));
147
148 TEST_ASSERT_EQUAL(-EINVAL,
149 rte_service_component_register(&service, NULL),
150 "Invalid callback");
151 service.callback = dummy_cb;
152
153 TEST_ASSERT_EQUAL(-EINVAL,
154 rte_service_component_register(&service, NULL),
155 "Invalid name");
156 snprintf(service.name, sizeof(service.name), DUMMY_SERVICE_NAME);
157
158 uint32_t id;
159 TEST_ASSERT_EQUAL(0, rte_service_component_register(&service, &id),
160 "Failed to register valid service");
161
162 rte_service_component_runstate_set(id, 1);
163
164 return TEST_SUCCESS;
165}
166
167/* verify get_by_name() service lookup */
168static int

Callers

nothing calls this directly

Calls 5

unregister_allFunction · 0.85
memsetFunction · 0.85
snprintfFunction · 0.85

Tested by

no test coverage detected