6#include <catch2/catch_test_macros.hpp>
30 auto const firstIndexTimeNs = 0ULL;
31 auto const secondIndexTimeNs = (
rate.denominator * 1'000'000'000ULL + (
rate.numerator / 2)) /
rate.numerator;
42 auto ts = std::timespec{0, 0};
44 gmtime_r(&ts.tv_sec, &t);
54TEST_CASE(
"Index <-> Timestamp roundtrip (current)",
"[time]")
71TEST_CASE(
"Index <-> Timestamp roundtrip (others)",
"[time]")
75 for (
auto i = 30'000'000U; i < 60'000'000U; ++i)
#define MXL_UNDEFINED_INDEX
struct mxlRational_t mxlRational
auto const rate
Compute the grain index for the flow rate and current TAI time.
REQUIRE(timeDelta< 33 '366 '667LL)
TEST_CASE("Invalid Times", "[time]")
auto const calculatedIndex
MXL_EXPORT uint64_t mxlIndexToTimestamp(mxlRational const *editRate, uint64_t index)
MXL_EXPORT uint64_t mxlTimestampToIndex(mxlRational const *editRate, uint64_t timestamp)
MXL_EXPORT uint64_t mxlGetNsUntilIndex(uint64_t index, mxlRational const *editRate)
MXL_EXPORT uint64_t mxlGetTime(void)