summaryrefslogtreecommitdiffhomepage
path: root/replay/replay_test.go
diff options
context:
space:
mode:
authorRiobard Zhan <me@riobard.com>2020-09-10 02:06:44 +0800
committerJason A. Donenfeld <Jason@zx2c4.com>2020-10-14 10:46:00 +0200
commit2c143dce0ff55feb35c7f6b9199479db88909903 (patch)
treebb22f8ee6531aaedb338caf56f404ad0d96c96e2 /replay/replay_test.go
parent22af3890f60d11472977f2fbdf50e6d5b406e356 (diff)
replay: minor API changes to more idiomatic Go
Signed-off-by: Riobard Zhan <me@riobard.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'replay/replay_test.go')
-rw-r--r--replay/replay_test.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/replay/replay_test.go b/replay/replay_test.go
index 5af66ff..fcffd20 100644
--- a/replay/replay_test.go
+++ b/replay/replay_test.go
@@ -14,10 +14,10 @@ import (
*
*/
-const RejectAfterMessages = (1 << 64) - (1 << 4) - 1
+const RejectAfterMessages = 1<<64 - 1<<13 - 1
func TestReplay(t *testing.T) {
- var filter ReplayFilter
+ var filter Filter
const T_LIM = windowSize + 1
@@ -29,7 +29,7 @@ func TestReplay(t *testing.T) {
}
}
- filter.Init()
+ filter.Reset()
T(0, true) /* 1 */
T(1, true) /* 2 */
@@ -67,7 +67,7 @@ func TestReplay(t *testing.T) {
T(0, false) /* 34 */
t.Log("Bulk test 1")
- filter.Init()
+ filter.Reset()
testNumber = 0
for i := uint64(1); i <= windowSize; i++ {
T(i, true)
@@ -76,7 +76,7 @@ func TestReplay(t *testing.T) {
T(0, false)
t.Log("Bulk test 2")
- filter.Init()
+ filter.Reset()
testNumber = 0
for i := uint64(2); i <= windowSize+1; i++ {
T(i, true)
@@ -85,14 +85,14 @@ func TestReplay(t *testing.T) {
T(0, false)
t.Log("Bulk test 3")
- filter.Init()
+ filter.Reset()
testNumber = 0
for i := uint64(windowSize + 1); i > 0; i-- {
T(i, true)
}
t.Log("Bulk test 4")
- filter.Init()
+ filter.Reset()
testNumber = 0
for i := uint64(windowSize + 2); i > 1; i-- {
T(i, true)
@@ -100,7 +100,7 @@ func TestReplay(t *testing.T) {
T(0, false)
t.Log("Bulk test 5")
- filter.Init()
+ filter.Reset()
testNumber = 0
for i := uint64(windowSize); i > 0; i-- {
T(i, true)
@@ -109,7 +109,7 @@ func TestReplay(t *testing.T) {
T(0, false)
t.Log("Bulk test 6")
- filter.Init()
+ filter.Reset()
testNumber = 0
for i := uint64(windowSize); i > 0; i-- {
T(i, true)