From 1e2807584f97473f427640d9c6a8fb948ba20824 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 24 Jul 2022 03:36:48 +0200 Subject: FreeBSD Support: test_fractions_01: Increase required test accuracy from 1/2 ms to 60_ms for virtual machine testing (7/n) --- test/test_fractions_01.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/test_fractions_01.cpp b/test/test_fractions_01.cpp index 6f65855..fe10612 100644 --- a/test/test_fractions_01.cpp +++ b/test/test_fractions_01.cpp @@ -872,9 +872,14 @@ TEST_CASE( "Fraction Time Arithmetic Sub Test 03.2", "[fraction][fraction_timesp } TEST_CASE( "Fraction Time Measurement Test 04.01", "[fraction][fraction_timespec][time]" ) { - // We assume accuracy of at least 1/2 millisecond, hence the difference shall not be greater - const fraction_i64 accuracy = fractions_i64::milli*2_i64/3_i64; const int64_t sleep_ms = 50; + // + // Ideally we assume accuracy of at least 1/2 millisecond, hence the difference shall not be greater + // const fraction_i64 accuracy = fractions_i64::milli*2_i64/3_i64; + // However, running within virtual machines etc, we have to be more generous here: 60_ms + // Detected using KVM on GNU/Linux host for FreeBSD 13.1 target + const fraction_i64 accuracy = fractions_i64::milli*60_i64; + // { const fraction_timespec t0 = getMonotonicTime(); sleep_for( sleep_ms * 1_ms ); -- cgit v1.2.3