#include <cstdint>
#include <ctime>
#include <catch2/catch_test_macros.hpp>
#include <mxl/mxl.h>
#include <mxl/time.h>
Go to the source code of this file.
◆ for()
Definition at line 75 of file test_time.cpp.
76 {
80 }
REQUIRE(timeDelta< 33 '366 '667LL)
MXL_EXPORT uint64_t mxlIndexToTimestamp(mxlRational const *editRate, uint64_t index)
MXL_EXPORT uint64_t mxlTimestampToIndex(mxlRational const *editRate, uint64_t timestamp)
◆ REQUIRE() [1/3]
◆ REQUIRE() [2/3]
◆ REQUIRE() [3/3]
◆ TEST_CASE() [1/3]
| TEST_CASE |
( |
"Index 0 and 1" | , |
|
|
"" | [time] ) |
Definition at line 26 of file test_time.cpp.
27{
29
30 auto const firstIndexTimeNs = 0ULL;
31 auto const secondIndexTimeNs = (
rate.denominator * 1'000'000'000ULL + (
rate.numerator / 2)) /
rate.numerator;
32
35
38}
struct mxlRational_t mxlRational
auto const rate
Compute the grain index for the flow rate and current TAI time.
◆ TEST_CASE() [2/3]
| TEST_CASE |
( |
"Invalid Times" | , |
|
|
"" | [time] ) |
Definition at line 10 of file test_time.cpp.
11{
16
18
24}
#define MXL_UNDEFINED_INDEX
MXL_EXPORT uint64_t mxlGetTime(void)
◆ TEST_CASE() [3/3]
| TEST_CASE |
( |
"Test TAI Epoch" | , |
|
|
"" | [time] ) |
Definition at line 40 of file test_time.cpp.
41{
42 auto ts = std::timespec{0, 0};
43 tm t;
44 gmtime_r(&ts.tv_sec, &t);
45
52}
◆ calculatedIndex
◆ currentIndex
◆ currentTime
◆ timeDelta
◆ timestamp