whisper: added lastTopicByte const

This commit is contained in:
b00ris 2018-01-16 08:07:33 +03:00
parent dfffdb8685
commit 6600165e27
No known key found for this signature in database
GPG key ID: 2F73E159EB73232C
2 changed files with 4 additions and 2 deletions

View file

@ -776,6 +776,7 @@ func TestWatchers(t *testing.T) {
func TestVariableTopics(t *testing.T) {
InitSingleTest()
const lastTopicByte = 3
var match bool
params, err := generateMessageParams()
if err != nil {
@ -802,7 +803,7 @@ func TestVariableTopics(t *testing.T) {
t.Fatalf("failed MatchEnvelope symmetric with seed %d, step %d.", seed, i)
}
f.Topics[i][1]++
f.Topics[i][lastTopicByte]++
match = f.MatchEnvelope(env)
if match {
t.Fatalf("MatchEnvelope symmetric with seed %d, step %d: false positive.", seed, i)

View file

@ -800,6 +800,7 @@ func TestWatchers(t *testing.T) {
func TestVariableTopics(t *testing.T) {
InitSingleTest()
const lastTopicByte = 3
var match bool
params, err := generateMessageParams()
if err != nil {
@ -826,7 +827,7 @@ func TestVariableTopics(t *testing.T) {
t.Fatalf("failed MatchEnvelope symmetric with seed %d, step %d.", seed, i)
}
f.Topics[i][1]++
f.Topics[i][lastTopicByte]++
match = f.MatchEnvelope(env)
if match {
t.Fatalf("MatchEnvelope symmetric with seed %d, step %d: false positive.", seed, i)