crosvm/devices
Daniel Verkamp 2689c838af base: simplify Clock/FakeClock API
Clock now has a single now() function that returns a std::time::Instant
rather than wrapping an Instant itself.

FakeClock provides the same now() API, except the Instant it reports is
only advanced when test code calls add_ns(). FakeClock continues to
provide the add_event() and add_ns() APIs used by tests.

The only functional difference is that the epoch used by FakeClock is
now whatever moment in (real) time it is created, rather than a fixed
timestamp, but this should not change the results of the tests. The only
way to observe the contents of an Instant is by comparing it to other
Instants, which should all be derived from the Clock/FakeClock now()
API.

BUG=None
TEST=cargo test -p base -- --test-threads=1
TEST=cargo test -p devices

Change-Id: I9a0ed8d252f213d85dba3dfbbcd1182e2db981f0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3736922
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-06 17:44:05 +00:00
..
src base: simplify Clock/FakeClock API 2022-07-06 17:44:05 +00:00
Cargo.toml virtio-vhost: Enable block tests 2022-07-01 23:44:09 +00:00