File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -18,22 +18,22 @@ namespace cpp = LIBC_NAMESPACE::cpp;
18
18
TEST (LlvmLibcGettimeofday, SmokeTest) {
19
19
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
20
20
void *tz = nullptr ;
21
- struct timeval tv;
21
+ timeval tv;
22
22
23
- int sleep_times[2 ] = {200 , 1000 };
23
+ suseconds_t sleep_times[2 ] = {200 , 1000 };
24
24
for (int i = 0 ; i < 2 ; i++) {
25
25
int ret = LIBC_NAMESPACE::gettimeofday (&tv, tz);
26
26
ASSERT_EQ (ret, 0 );
27
27
28
- int sleep_time = sleep_times[i];
28
+ suseconds_t sleep_time = sleep_times[i];
29
29
// Sleep for {sleep_time} microsceconds.
30
- struct timespec tim = {0 , sleep_time * 1000 };
31
- struct timespec tim2 = {0 , 0 };
30
+ timespec tim = {0 , sleep_time * 1000 };
31
+ timespec tim2 = {0 , 0 };
32
32
ret = LIBC_NAMESPACE::nanosleep (&tim, &tim2);
33
33
34
34
// Call gettimeofday again and verify that it is more {sleep_time}
35
35
// microscecods.
36
- struct timeval tv1;
36
+ timeval tv1;
37
37
ret = LIBC_NAMESPACE::gettimeofday (&tv1, tz);
38
38
ASSERT_EQ (ret, 0 );
39
39
ASSERT_GE (tv1.tv_usec - tv.tv_usec , sleep_time);
You can’t perform that action at this time.
0 commit comments