Skip to content

Commit

Permalink
Add trace to the bsls_timeutils test error.
Browse files Browse the repository at this point in the history
  • Loading branch information
osubboo committed Jan 9, 2025
1 parent d596cfe commit a7e5fdf
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions groups/bsl/bsls/bsls_timeutil.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2112,24 +2112,24 @@ int main(int argc, char *argv[])
printf("st2: %lld - st1: %lld = %lld\n", st2, st1, st2 - st1);
}

ASSERT(wt2 - wt1 >= timeQuantum);
// Our wall time is over a timeQuantum.
// Our wall time is over a timeQuantum.
ASSERTV(wt2 - wt1, timeQuantum, wt2 - wt1 >= timeQuantum);

ASSERT(ut2 - ut1 >= timeQuantum);
// We ran at least a timeQuantum.
// We ran at least a timeQuantum.
ASSERTV(ut2 - ut1, timeQuantum, ut2 - ut1 >= timeQuantum);

ASSERT(st2 - st1 >= 0); // And system time did not go backward.
// And system time did not go backward.
ASSERTV(st2, st1, st2 - st1 >= 0);

// And our wall time was greater than our user and system time
// together, allowing for quantization error (in both user and
// system time).
#if defined(BSLS_PLATFORM_OS_WINDOWS) || defined(BSLS_PLATFORM_OS_CYGWIN)
ASSERT((wt2 - wt1) - (ut2 - ut1) - (st2 - st1)
+ 10 * windowsFudge + 2 * timeQuantum >= 0);
#else
ASSERT((wt2 - wt1) - (ut2 - ut1) - (st2 - st1) +
2 * timeQuantum >= 0);
// And our wall time was greater than
// our user and system time together,
// allowing for quantization error
// (in both user and system time).
#endif
}
} break;
Expand Down

0 comments on commit a7e5fdf

Please sign in to comment.