]> git.saurik.com Git - apple/xnu.git/blob - tests/mach_timebase_info.c
xnu-7195.101.1.tar.gz
[apple/xnu.git] / tests / mach_timebase_info.c
1 #include <mach/mach_time.h>
2
3 #include <darwintest.h>
4
5 T_GLOBAL_META(T_META_RUN_CONCURRENTLY(true));
6
7 extern kern_return_t mach_timebase_info_trap(mach_timebase_info_t info);
8
9 T_DECL(mach_timebase_info, "mach_timebase_info(_trap)",
10 T_META_ALL_VALID_ARCHS(true), T_META_LTEPHASE(LTE_POSTINIT))
11 {
12 mach_timebase_info_data_t a, b, c;
13
14 T_ASSERT_EQ(KERN_SUCCESS, mach_timebase_info(&a), NULL);
15 T_ASSERT_EQ(KERN_SUCCESS, mach_timebase_info(&b), NULL);
16 T_ASSERT_EQ(KERN_SUCCESS, mach_timebase_info_trap(&c), NULL);
17
18 T_EXPECT_EQ(a.numer, b.numer, NULL);
19 T_EXPECT_EQ(a.denom, b.denom, NULL);
20 T_EXPECT_EQ(a.numer, c.numer, NULL);
21 T_EXPECT_EQ(a.denom, c.denom, NULL);
22 }