| 2627 | static int tc2_count = 0; |
| 2628 | |
| 2629 | int |
| 2630 | cont_schedule_handler(TSCont contp, TSEvent event, void * /* edata ATS_UNUSED */) |
| 2631 | { |
| 2632 | if (event == TS_EVENT_IMMEDIATE) { |
| 2633 | // Test Case 1 |
| 2634 | SDK_RPRINT(SDK_ContSchedule_test, "TSContScheduleOnPool", "TestCase1", TC_PASS, "ok"); |
| 2635 | tc1_count++; |
| 2636 | } else if (event == TS_EVENT_TIMEOUT) { |
| 2637 | // Test Case 2 |
| 2638 | SDK_RPRINT(SDK_ContSchedule_test, "TSContScheduleOnPool", "TestCase2", TC_PASS, "ok"); |
| 2639 | tc2_count++; |
| 2640 | } else { |
| 2641 | // If we receive a bad event, it's a failure |
| 2642 | SDK_RPRINT(SDK_ContSchedule_test, "TSContScheduleOnPool", "TestCase1|2", TC_FAIL, "received unexpected event number %d", event); |
| 2643 | *SDK_ContSchedule_pstatus = REGRESSION_TEST_FAILED; |
| 2644 | return 0; |
| 2645 | } |
| 2646 | |
| 2647 | // We expect to be called once for TC1 and once for TC2 |
| 2648 | if ((tc1_count == 1) && (tc2_count == 1)) { |
| 2649 | *SDK_ContSchedule_pstatus = REGRESSION_TEST_PASSED; |
| 2650 | } |
| 2651 | // If TC1 or TC2 executed more than once, something is fishy.. |
| 2652 | else if (tc1_count + tc2_count >= 2) { |
| 2653 | *SDK_ContSchedule_pstatus = REGRESSION_TEST_FAILED; |
| 2654 | } |
| 2655 | |
| 2656 | TSContDestroy(contp); |
| 2657 | return 0; |
| 2658 | } |
| 2659 | |
| 2660 | /* Mutex */ |
| 2661 |
nothing calls this directly
no test coverage detected