Beispiel #1
0
func TestNewSdnv(t *testing.T) {
	for i := uint64(0); i < 10; i++ {
		s := sdnv.NewSdnv(i)
		if i != s.Value {
			t.Error("expected", i, "==", s.Value)
		}
	}
}
Beispiel #2
0
func Example_unmarshal() {
	s := sdnv.NewSdnv(0)
	data := []byte{0x95, 0x3c}
	err := s.Unmarshal(data)
	if err == nil {
		fmt.Println("sdnv", s)
	} else {
		fmt.Println("error", err)
	}
}
Beispiel #3
0
func Example_marshal() {
	s := sdnv.NewSdnv(10)
	data := s.Marshal()
	fmt.Println("data", data)
}