22 lines
294 B
Go
22 lines
294 B
Go
package node
|
|
|
|
import "testing"
|
|
|
|
func TestHeaderMarshalParse(t *testing.T) {
|
|
nIn := header{
|
|
StreamID: 23,
|
|
Counter: 3212,
|
|
SourceIP: 34,
|
|
DestIP: 200,
|
|
}
|
|
|
|
buf := make([]byte, headerSize)
|
|
nIn.Marshal(buf)
|
|
|
|
nOut := header{}
|
|
nOut.Parse(buf)
|
|
if nIn != nOut {
|
|
t.Fatal(nIn, nOut)
|
|
}
|
|
}
|