Skip to content

Commit

Permalink
Generate a random value of the correct type
Browse files Browse the repository at this point in the history
  • Loading branch information
knutwalker committed Sep 18, 2023
1 parent a7f2494 commit cf00306
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 cf00306

Please sign in to comment.