Fix randomize for bytea and int32
This commit is contained in:
parent
5b97a17235
commit
bb62a81c38
1 changed files with 3 additions and 3 deletions
|
@ -463,7 +463,7 @@ func getStructRandValue(s *Seed, typ reflect.Type) interface{} {
|
||||||
case typeNullFloat64:
|
case typeNullFloat64:
|
||||||
return null.NewFloat64(float64(s.nextInt()%10)/10.0+float64(s.nextInt()%10), true)
|
return null.NewFloat64(float64(s.nextInt()%10)/10.0+float64(s.nextInt()%10), true)
|
||||||
case typeNullInt:
|
case typeNullInt:
|
||||||
return null.NewInt(s.nextInt(), true)
|
return null.NewInt(int(int32(s.nextInt())), true)
|
||||||
case typeNullInt8:
|
case typeNullInt8:
|
||||||
return null.NewInt8(int8(s.nextInt()), true)
|
return null.NewInt8(int8(s.nextInt()), true)
|
||||||
case typeNullInt16:
|
case typeNullInt16:
|
||||||
|
@ -483,7 +483,7 @@ func getStructRandValue(s *Seed, typ reflect.Type) interface{} {
|
||||||
case typeNullUint64:
|
case typeNullUint64:
|
||||||
return null.NewUint64(uint64(s.nextInt()), true)
|
return null.NewUint64(uint64(s.nextInt()), true)
|
||||||
case typeNullBytes:
|
case typeNullBytes:
|
||||||
return null.NewBytes(randByteSlice(s, 16), true)
|
return null.NewBytes(randByteSlice(s, 1), true)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -565,7 +565,7 @@ func getVariableRandValue(s *Seed, kind reflect.Kind, typ reflect.Type) interfac
|
||||||
if sliceVal.Kind() != reflect.Uint8 {
|
if sliceVal.Kind() != reflect.Uint8 {
|
||||||
return errors.Errorf("unsupported slice type: %T, was expecting byte slice.", typ.String())
|
return errors.Errorf("unsupported slice type: %T, was expecting byte slice.", typ.String())
|
||||||
}
|
}
|
||||||
return randByteSlice(s, 5+s.nextInt()%20)
|
return randByteSlice(s, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Add table
Reference in a new issue