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