Skip to content

Commit

Permalink
Merge pull request #8152 from knutwalker/hsdlst
Browse files Browse the repository at this point in the history
Generate a random value of the correct type
  • Loading branch information
knutwalker authored Sep 18, 2023
2 parents c0330a9 + cf00306 commit fba55ed
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public static String randomValue(TypeName valueType) {
} else if (valueType == TypeName.FLOAT) {
return "random.nextFloat()";
} else if (valueType == TypeName.DOUBLE) {
return "random.nextFloat()";
return "random.nextDouble()";
} else if (valueType.equals(ArrayTypeName.of(TypeName.BYTE))) {
return "new byte[] { " + randomValue(TypeName.BYTE) + " }";
} else if (valueType.equals(ArrayTypeName.of(TypeName.SHORT))) {
Expand Down

0 comments on commit fba55ed

Please sign in to comment.