aboutsummaryrefslogtreecommitdiffstats
path: root/replay/replay_test.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-23 02:32:02 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-23 03:58:27 +0200
commit5a2228a5c910ada948677f1dd3fcc59f74e5cb20 (patch)
treebafb31cbcc18221e2299f8fef21d9c2f4471f706 /replay/replay_test.go
parentMove tun to subpackage (diff)
downloadwireguard-go-5a2228a5c910ada948677f1dd3fcc59f74e5cb20.tar.xz
wireguard-go-5a2228a5c910ada948677f1dd3fcc59f74e5cb20.zip
Move replay into subpackage
Diffstat (limited to '')
-rw-r--r--replay/replay_test.go (renamed from replay_test.go)6
1 files changed, 4 insertions, 2 deletions
diff --git a/replay_test.go b/replay/replay_test.go
index 8b2e57d..da39498 100644
--- a/replay_test.go
+++ b/replay/replay_test.go
@@ -4,7 +4,7 @@
* Copyright (C) 2017-2018 Mathias N. Hall-Andersen <mathias@hall-andersen.dk>.
*/
-package main
+package replay
import (
"testing"
@@ -15,6 +15,8 @@ import (
*
*/
+const RejectAfterMessages = (1 << 64) - (1 << 4) - 1
+
func TestReplay(t *testing.T) {
var filter ReplayFilter
@@ -23,7 +25,7 @@ func TestReplay(t *testing.T) {
testNumber := 0
T := func(n uint64, v bool) {
testNumber++
- if filter.ValidateCounter(n) != v {
+ if filter.ValidateCounter(n, RejectAfterMessages) != v {
t.Fatal("Test", testNumber, "failed", n, v)
}
}