register a single dummy service */
| 137 | |
| 138 | /* register a single dummy service */ |
| 139 | static int |
| 140 | dummy_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 */ |
| 168 | static int |
nothing calls this directly
no test coverage detected