]> granicus.if.org Git - pdns/commit
rec: Don't mix time() and gettimeofday() in our unit tests
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 8 Jan 2018 15:44:50 +0000 (16:44 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 8 Jan 2018 15:44:50 +0000 (16:44 +0100)
commit606accb0e70e07b74f8213931a8dfc7b49173dd1
tree428874202e5f989637a9c1ab67bd933485113cf3
parent047b4e80c8211911778d004cb99fa24d83619004
rec: Don't mix time() and gettimeofday() in our unit tests

It turns out that, at least on Linux, doing

```
struct timeval now;
gettimeofday(&now, nullptr);
now.tv_sec - time(nullptr);
```

might be 1, without the time actually going backward. So let's just
be consistent in our calls and we should far less false positive
during our tests.
pdns/recursordist/negcache.cc
pdns/recursordist/test-syncres_cc.cc