~fnux/yggdrasil-go-coap

yggdrasil-go-coap/multicastClient_test.go -rw-r--r-- 1.7 KiB
614f652bTimothée Floure Add syntax highlighting to code snippets in README 1 year, 6 months ago
                                                                                
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package coap

import (
	"net"
	"testing"
)

func TestServingIPv4MCastBlockWiseSzx16(t *testing.T) {
	testServingMCast(t, "udp4-mcast", "225.0.1.187:11111", true, BlockWiseSzx16, 1033)
}

func TestServingIPv4MCastBlockWiseSzx32(t *testing.T) {
	testServingMCast(t, "udp4-mcast", "225.0.1.187:11111", true, BlockWiseSzx32, 1033)
}

func TestServingIPv4MCastBlockWiseSzx64(t *testing.T) {
	testServingMCast(t, "udp4-mcast", "225.0.1.187:11111", true, BlockWiseSzx64, 1033)
}

func TestServingIPv4MCastBlockWiseSzx128(t *testing.T) {
	testServingMCast(t, "udp4-mcast", "225.0.1.187:11111", true, BlockWiseSzx128, 1033)
}

func TestServingIPv4MCastBlockWiseSzx256(t *testing.T) {
	testServingMCast(t, "udp4-mcast", "225.0.1.187:11111", true, BlockWiseSzx256, 1033)
}

func TestServingIPv4MCastBlockWiseSzx512(t *testing.T) {
	testServingMCast(t, "udp4-mcast", "225.0.1.187:11111", true, BlockWiseSzx512, 1033)
}

func TestServingIPv4MCastBlockWiseSzx1024(t *testing.T) {
	testServingMCast(t, "udp4-mcast", "225.0.1.187:11111", true, BlockWiseSzx1024, 1033)
}

func TestServingIPv6MCastByClient(t *testing.T) {
	testServingMCast(t, "udp6-mcast", "[ff03::158]:11111", false, BlockWiseSzx16, 1033)
}

func TestServingIPv4AllInterfacesMCastByClient(t *testing.T) {
	ifis, err := net.Interfaces()
	if err != nil {
		t.Fatalf("unable to get interfaces: %v", err)
	}
	testServingMCastWithIfaces(t, "udp4-mcast", "225.0.1.187:11111", false, BlockWiseSzx16, 1033, ifis)
}

func TestServingIPv6AllInterfacesMCastByClient(t *testing.T) {
	ifis, err := net.Interfaces()
	if err != nil {
		t.Fatalf("unable to get interfaces: %v", err)
	}
	testServingMCastWithIfaces(t, "udp6-mcast", "[ff03::158]:11111", false, BlockWiseSzx16, 1033, ifis)
}