summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/timer_test.go
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@google.com>2021-05-26 06:47:52 -0700
committergVisor bot <gvisor-bot@google.com>2021-05-26 06:49:57 -0700
commitfcad6f91a3f292b6b76be10f03baf05ee5245d3d (patch)
treefa383878218fe0c69c5c346a08cfd953e398ee2d /pkg/tcpip/timer_test.go
parentb63e61828d0652ad1769db342c17a3529d2d24ed (diff)
Use the stack clock everywhere
Updates #5939. Updates #6012. RELNOTES: n/a PiperOrigin-RevId: 375931554
Diffstat (limited to 'pkg/tcpip/timer_test.go')
-rw-r--r--pkg/tcpip/timer_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/pkg/tcpip/timer_test.go b/pkg/tcpip/timer_test.go
index e6783b126..8c43dd627 100644
--- a/pkg/tcpip/timer_test.go
+++ b/pkg/tcpip/timer_test.go
@@ -38,6 +38,21 @@ func TestMonotonicTimeBefore(t *testing.T) {
}
}
+func TestMonotonicTimeAfter(t *testing.T) {
+ var mt tcpip.MonotonicTime
+ if mt.After(mt) {
+ t.Errorf("%#v.After(%#v)", mt, mt)
+ }
+
+ one := mt.Add(1)
+ if mt.After(one) {
+ t.Errorf("%#v.After(%#v)", mt, one)
+ }
+ if !one.After(mt) {
+ t.Errorf("!%#v.After(%#v)", one, mt)
+ }
+}
+
func TestMonotonicTimeAddSub(t *testing.T) {
var mt tcpip.MonotonicTime
if one, two := mt.Add(2), mt.Add(1).Add(1); one != two {