]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cypherpunks.ru/nncp/tx_test.go
Raise copyright years
[nncp.git] / src / cypherpunks.ru / nncp / tx_test.go
index fd2117bc6238d3789c09edbee5a090e29497c009..d97be3debc487f5955388b4a7808e333745d6492 100644 (file)
@@ -1,6 +1,6 @@
 /*
 NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2017 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2018 Sergey Matveev <stargrave@stargrave.org>
 
 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
@@ -33,7 +33,7 @@ import (
 )
 
 func TestTx(t *testing.T) {
-       f := func(hops uint8, pathSrc, data string, nice uint8) bool {
+       f := func(hops uint8, pathSrc, data string, nice uint8, padSize int16) bool {
                if len(pathSrc) > int(MaxPathSize) {
                        pathSrc = pathSrc[:MaxPathSize]
                }
@@ -58,6 +58,7 @@ func TestTx(t *testing.T) {
                        LogPath: path.Join(spool, "log.log"),
                        Debug:   true,
                        Self:    nodeOur,
+                       SelfId:  nodeOur.Id,
                        Neigh:   make(map[NodeId]*Node, hops),
                        Alias:   make(map[string]*NodeId),
                }
@@ -77,7 +78,14 @@ func TestTx(t *testing.T) {
                }
                pkt, err := NewPkt(PktTypeMail, pathSrc)
                src := strings.NewReader(data)
-               dstNode, err := ctx.Tx(nodeTgt, pkt, 123, int64(src.Len()), src)
+               dstNode, err := ctx.Tx(
+                       nodeTgt,
+                       pkt,
+                       123,
+                       int64(src.Len()),
+                       int64(padSize),
+                       src,
+               )
                if err != nil {
                        return false
                }
@@ -99,7 +107,7 @@ func TestTx(t *testing.T) {
                vias := append(nodeTgt.Via, nodeTgt.Id)
                for i, hopId := range vias {
                        hopOur := privates[*hopId]
-                       foundNode, err := PktEncRead(hopOur, ctx.Neigh, &bufR, &bufW)
+                       foundNode, _, err := PktEncRead(hopOur, ctx.Neigh, &bufR, &bufW)
                        if err != nil {
                                return false
                        }