| 1 |
/* |
| 2 |
* |
| 3 |
* Copyright 2021 gRPC authors. |
| 4 |
* |
| 5 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 |
* you may not use this file except in compliance with the License. |
| 7 |
* You may obtain a copy of the License at |
| 8 |
* |
| 9 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 10 |
* |
| 11 |
* Unless required by applicable law or agreed to in writing, software |
| 12 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 13 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 |
* See the License for the specific language governing permissions and |
| 15 |
* limitations under the License. |
| 16 |
* |
| 17 |
*/ |
| 18 |
|
| 19 |
#import <XCTest/XCTest.h> |
| 20 |
|
| 21 |
#import "test/runner.h" |
| 22 |
#import "test/task.h" |
| 23 |
|
| 24 |
// Tests in: |
| 25 |
// libuv/test/test-timer.c |
| 26 |
// libuv/test/test-timer-again.c |
| 27 |
// libuv/test/test-timer-from-check.c |
| 28 |
|
| 29 |
TEST_DECLARE(timer) |
| 30 |
TEST_DECLARE(timer_init) |
| 31 |
TEST_DECLARE(timer_again) |
| 32 |
// TEST_DECLARE(timer_start_twice) //withhold until libuv patched |
| 33 |
TEST_DECLARE(timer_order) |
| 34 |
TEST_DECLARE(timer_huge_timeout) |
| 35 |
TEST_DECLARE(timer_huge_repeat) |
| 36 |
TEST_DECLARE(timer_run_once) |
| 37 |
TEST_DECLARE(timer_from_check) |
| 38 |
TEST_DECLARE(timer_is_closing) |
| 39 |
TEST_DECLARE(timer_null_callback) |
| 40 |
TEST_DECLARE(timer_early_check) |
| 41 |
|
| 42 |
#define TASK_LIST_START_LOCAL static task_entry_t TEST_TASKS[] = { |
| 43 |
TASK_LIST_START_LOCAL |
| 44 |
TEST_ENTRY(timer) |
| 45 |
TEST_ENTRY(timer_init) |
| 46 |
TEST_ENTRY(timer_again) |
| 47 |
// TEST_ENTRY(timer_start_twice) //withhold until libuv patched |
| 48 |
TEST_ENTRY(timer_order) |
| 49 |
TEST_ENTRY(timer_huge_timeout) |
| 50 |
TEST_ENTRY(timer_huge_repeat) |
| 51 |
TEST_ENTRY(timer_run_once) |
| 52 |
TEST_ENTRY(timer_from_check) |
| 53 |
TEST_ENTRY(timer_is_closing) |
| 54 |
TEST_ENTRY(timer_null_callback) |
| 55 |
TEST_ENTRY(timer_early_check) |
| 56 |
TASK_LIST_END |
| 57 |
|
| 58 |
@interface LibuvTimerTests : XCTestCase |
| 59 |
|
| 60 |
@end |
| 61 |
|
| 62 |
@implementation LibuvTimerTests |
| 63 |
|
| 64 |
- (void)testTimerAll { |
| 65 |
for (task_entry_t* task = TEST_TASKS; task->main; task++) { |
| 66 |
task->main(); |
| 67 |
} |
| 68 |
} |
| 69 |
|
| 70 |
@end |