From: Remi Gacogne Date: Tue, 17 Jan 2023 15:33:06 +0000 (+0100) Subject: dnsdist: Fix time computation in the async unit tests X-Git-Tag: dnsdist-1.8.0-rc1~86^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4697121191f5005549c4cd2886e2d5c80237b3a;p=thirdparty%2Fpdns.git dnsdist: Fix time computation in the async unit tests --- diff --git a/pdns/dnsdistdist/test-dnsdistasync.cc b/pdns/dnsdistdist/test-dnsdistasync.cc index 7cf9df5f1e..6dac39e11d 100644 --- a/pdns/dnsdistdist/test-dnsdistasync.cc +++ b/pdns/dnsdistdist/test-dnsdistasync.cc @@ -84,7 +84,8 @@ BOOST_AUTO_TEST_CASE(test_Basic) struct timeval ttd; gettimeofday(&ttd, nullptr); // timeout in 100 ms - ttd.tv_usec += 100000; + const timeval sub{0, 100000}; + timersub(&ttd, &sub, &ttd); holder->push(asyncID, queryID, ttd, std::make_unique()); BOOST_CHECK(!holder->empty());