X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fnncp%2Fpkt_test.go;h=678cbf474a420fba1d7c9aa1becee2822ad17389;hb=dd92823db3d72fb21a4c712a7fb052dce16443dd;hp=e0765b3a7179c53be091cc421f4d4ff63c58d50a;hpb=b711e2e5767124b1d12fd548ad9605d77c0edbb6;p=nncp.git diff --git a/src/cypherpunks.ru/nncp/pkt_test.go b/src/cypherpunks.ru/nncp/pkt_test.go index e0765b3..678cbf4 100644 --- a/src/cypherpunks.ru/nncp/pkt_test.go +++ b/src/cypherpunks.ru/nncp/pkt_test.go @@ -1,11 +1,10 @@ /* NNCP -- Node to Node copy, utilities for store-and-forward data exchange -Copyright (C) 2016-2018 Sergey Matveev +Copyright (C) 2016-2019 Sergey Matveev This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. +the Free Software Foundation, version 3 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -81,7 +80,12 @@ func TestPktEncRead(t *testing.T) { if err != nil { panic(err) } - f := func(path string, pathSize uint8, data [1 << 16]byte, size, padSize uint16, junk []byte) bool { + f := func( + path string, + pathSize uint8, + data [1 << 16]byte, + size, padSize uint16, + junk []byte) bool { dataR := bytes.NewReader(data[:]) var ct bytes.Buffer if len(path) > int(pathSize) { @@ -115,7 +119,7 @@ func TestPktEncRead(t *testing.T) { if *node.Id != *node1.Id { return false } - if sizeGot != int64(size) { + if sizeGot != sizeWithTags(PktOverhead+int64(size)) { return false } var pktBuf bytes.Buffer