* Single-threaded timer test. Create several intervals using the * TEST1 timer. The test script can verify that an aggregate Trace2 * "timer" event is emitted indicating that we started+stopped the * timer the requested number of times. */
| 242 | * timer the requested number of times. |
| 243 | */ |
| 244 | static int ut_100timer(int argc, const char **argv) |
| 245 | { |
| 246 | const char *usage_error = |
| 247 | "expect <count> <ms_delay>"; |
| 248 | |
| 249 | int count = 0; |
| 250 | int delay = 0; |
| 251 | int k; |
| 252 | |
| 253 | if (argc != 2) |
| 254 | die("%s", usage_error); |
| 255 | if (get_i(&count, argv[0])) |
| 256 | die("%s", usage_error); |
| 257 | if (get_i(&delay, argv[1])) |
| 258 | die("%s", usage_error); |
| 259 | |
| 260 | for (k = 0; k < count; k++) { |
| 261 | trace2_timer_start(TRACE2_TIMER_ID_TEST1); |
| 262 | sleep_millisec(delay); |
| 263 | trace2_timer_stop(TRACE2_TIMER_ID_TEST1); |
| 264 | } |
| 265 | |
| 266 | return 0; |
| 267 | } |
| 268 | |
| 269 | struct ut_101_data { |
| 270 | int count; |
nothing calls this directly
no test coverage detected