From f034a1cfb38afaf3dd13a047de4fa0dc426b713c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Tue, 8 Aug 2023 11:10:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/node_test.go | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/internal/nodes/node_test.go b/internal/nodes/node_test.go index affa782..5cacf10 100644 --- a/internal/nodes/node_test.go +++ b/internal/nodes/node_test.go @@ -1,11 +1,7 @@ package nodes import ( - "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" - "github.com/golang/protobuf/proto" _ "github.com/iwind/TeaGo/bootstrap" - "io" - "strconv" "testing" ) @@ -22,29 +18,3 @@ func TestNode_Test(t *testing.T) { } t.Log("ok") } - -func TestNode_Proto_Buffer(t *testing.T) { - buff := proto.NewBuffer([]byte{}) - for i := 0; i < 10; i++ { - err := buff.EncodeMessage(&pb.NodeStreamMessage{ - RequestId: int64(i), - Code: "msg" + strconv.Itoa(i), - }) - if err != nil { - t.Fatal(err) - } - } - - for i := 0; i < 11; i++ { - msg := &pb.NodeStreamMessage{} - err := buff.DecodeMessage(msg) - if err != nil { - if err == io.EOF || err == io.ErrUnexpectedEOF { - break - } else { - t.Fatal(err) - } - } - t.Log(msg.Code, msg.RequestId) - } -}