|
|
|
@ -312,8 +312,8 @@ func TestGenerateRunDecodeWrongType(test *testing.T) {
|
|
|
|
reflectValue.Elem().Interface())
|
|
|
|
reflectValue.Elem().Interface())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if n != len(data) - 1 {
|
|
|
|
if n != len(data) {
|
|
|
|
log.Fatalf("n not equal: %d != %d", n, len(data) - 1)
|
|
|
|
log.Fatalf("n not equal: %d != %d", n, len(data))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
log.Println("- MessageInt8")
|
|
|
|
log.Println("- MessageInt8")
|
|
|
|
@ -341,8 +341,20 @@ func TestGenerateRunDecodeWrongType(test *testing.T) {
|
|
|
|
if reflectValue.Len() != 0 {
|
|
|
|
if reflectValue.Len() != 0 {
|
|
|
|
log.Fatalf("len(destination) not zero: %v", reflectValue.Interface())
|
|
|
|
log.Fatalf("len(destination) not zero: %v", reflectValue.Interface())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if n != len(data) - 1 {
|
|
|
|
if n != len(data) {
|
|
|
|
log.Fatalf("n not equal: %d != %d", n, len(data) - 1)
|
|
|
|
log.Fatalf("n not equal: %d != %d", n, len(data))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
anyCase := func(destination Message) {
|
|
|
|
|
|
|
|
n, err := destination.Decode(tape.NewDecoder(bytes.NewBuffer(data)),)
|
|
|
|
|
|
|
|
if err != nil { log.Fatalf("error: %v | n: %d", err, n) }
|
|
|
|
|
|
|
|
reflectDestination := reflect.ValueOf(destination)
|
|
|
|
|
|
|
|
reflectValue := reflectDestination.Elem()
|
|
|
|
|
|
|
|
if reflectValue == reflect.Zero(reflectValue.Type()) {
|
|
|
|
|
|
|
|
log.Fatalf("len(destination) not zero: %v", reflectValue.Interface())
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if n != len(data) {
|
|
|
|
|
|
|
|
log.Fatalf("n not equal: %d != %d", n, len(data))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// SBA/LBA types should only assign to other SBA/LBA types
|
|
|
|
// SBA/LBA types should only assign to other SBA/LBA types
|
|
|