testing_clock.h 748 B

123456789101112131415161718192021
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. #ifndef TESTING_CLOCK_H_
  5. #define TESTING_CLOCK_H_
  6. #include "ua_types.h"
  7. /* The testing clock is used for reproducible unit tests that require precise
  8. * timings. It implements the following functions from ua_types.h. They return a
  9. * deterministic time that can be advanced manually with UA_sleep.
  10. *
  11. * UA_DateTime UA_EXPORT UA_DateTime_now(void);
  12. * UA_DateTime UA_EXPORT UA_DateTime_nowMonotonic(void); */
  13. /* Forwards the testing clock by the given duration in ms */
  14. void UA_sleep(UA_DateTime duration);
  15. #endif /* TESTING_CLOCK_H_ */