-
Notifications
You must be signed in to change notification settings - Fork 35
/
bind_test.go
39 lines (31 loc) · 898 Bytes
/
bind_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2018 The go-hep Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !travis
package xrootd
import (
"context"
"testing"
)
func testNewSubSession(t *testing.T, addr string) {
session, err := newSession(context.Background(), addr, "gopher", "", nil)
if err != nil {
t.Fatalf("could not create initialSession: %v", err)
}
defer session.Close()
subSession, err := newSubSession(context.Background(), session)
if err != nil {
t.Fatalf("could not create subSession: %v", err)
}
if subSession.pathID == 0 {
t.Fatalf("incorrect subSession.pathID value of 0 was received")
}
session.subs[subSession.pathID] = subSession
}
func TestNewSubSession(t *testing.T) {
for _, addr := range testClientAddrs {
t.Run(addr, func(t *testing.T) {
testNewSubSession(t, addr)
})
}
}