]> git.saurik.com Git - apple/xnu.git/blame - tests/mach_timebase_info.c
xnu-6153.41.3.tar.gz
[apple/xnu.git] / tests / mach_timebase_info.c
CommitLineData
39037602
A
1#include <mach/mach_time.h>
2
3#include <darwintest.h>
4
cb323159
A
5T_GLOBAL_META(T_META_RUN_CONCURRENTLY(true));
6
39037602
A
7extern kern_return_t mach_timebase_info_trap(mach_timebase_info_t info);
8
9T_DECL(mach_timebase_info, "mach_timebase_info(_trap)",
0a7de745 10 T_META_ALL_VALID_ARCHS(true), T_META_LTEPHASE(LTE_POSTINIT))
39037602
A
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}