@@ -25,61 +25,3 @@ func TestSubtractAndNegFilter(t *testing.T) {
25
25
t .Errorf ("Expected only one remaining address: %s" , localhost .String ())
26
26
}
27
27
}
28
-
29
- func TestIsFDCostlyTransport (t * testing.T ) {
30
- tcpMa := newMultiaddr (t , "/ip4/127.0.0.1/tcp/1234" )
31
- if ok := IsFDCostlyTransport (tcpMa ); ! ok {
32
- t .Errorf ("Expected address %s to need a new file descriptor per new connection" , tcpMa .String ())
33
- }
34
- udpMa := newMultiaddr (t , "/ip4/127.0.0.1/udp/1234" )
35
- if ok := IsFDCostlyTransport (udpMa ); ok {
36
- t .Errorf ("Expected address %s to not need a new file descriptor per new connection" , udpMa .String ())
37
- }
38
- }
39
-
40
- func TestIsFDCostly (t * testing.T ) {
41
- good := []ma.Multiaddr {
42
- newMultiaddr (t , "/ip4/127.0.0.1/tcp/1234" ),
43
- newMultiaddr (t , "/ip4/0.0.0.0/tcp/1234" ),
44
- newMultiaddr (t , "/ip6/::1/tcp/1234" ),
45
- newMultiaddr (t , "/ip6/::/tcp/1234" ),
46
- newMultiaddr (t , "/ip6/fe80::1/tcp/1234" ),
47
- newMultiaddr (t , "/ip6/fe80::/tcp/1234" ),
48
- newMultiaddr (t , "/ip6/fe80::/tcp/1234/http" ),
49
- newMultiaddr (t , "/ip4/127.0.0.1/tcp/1234/http" ),
50
- }
51
-
52
- bad := []ma.Multiaddr {
53
- newMultiaddr (t , "/ip4/127.0.0.1/udp/1234" ),
54
- newMultiaddr (t , "/ip4/0.0.0.0/udp/1234/utp" ),
55
- newMultiaddr (t , "/ip6/::1/udp/1234" ),
56
- newMultiaddr (t , "/ip6/::/udp/1234" ),
57
- }
58
-
59
- for _ , a := range bad {
60
- if IsFDCostlyTransport (a ) {
61
- t .Errorf ("addr %s should not be fd costly" , a )
62
- }
63
- }
64
-
65
- for _ , a := range good {
66
- if ! IsFDCostlyTransport (a ) {
67
- t .Errorf ("addr %s should be fd costly" , a )
68
- }
69
- }
70
- }
71
-
72
- func TestIsFdCostlyMalformed (t * testing.T ) {
73
- bad := []ma.Multiaddr {
74
- newMultiaddr (t , "/ip4/127.0.0.1/" ),
75
- newMultiaddr (t , "/ip4/0.0.0.0/" ),
76
- newMultiaddr (t , "/ip6/::1/" ),
77
- newMultiaddr (t , "/ip6/::/" ),
78
- }
79
-
80
- for _ , a := range bad {
81
- if IsFDCostlyTransport (a ) {
82
- t .Errorf ("addr %s should not be fd costly" , a )
83
- }
84
- }
85
- }
0 commit comments