vppn/peer/nonce_test.go
2024-12-12 21:11:17 +01:00

26 lines
339 B
Go

package peer
import (
"testing"
)
func TestMarshalParseNonce(t *testing.T) {
nIn := Nonce{
Counter: 3212,
SourceIP: 34,
ViaIP: 20,
DestIP: 200,
StreamID: 4,
PacketType: 44,
}
buf := make([]byte, NONCE_SIZE)
nIn.Marshal(buf)
nOut := Nonce{}
nOut.Parse(buf)
if nIn != nOut {
t.Fatal(nIn, nOut)
}
}