Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
changes in calculatorWorksCorrectly() --> should work now
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Hinz committed Jun 30, 2013
1 parent 1c01b44 commit 066da23
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -199,13 +199,13 @@ public void calculatorWorksCorrectly() throws IOException, ParserConfigurationEx

Random rand = new Random();
int a = rand.nextInt(100);
payload.replace("@@@a@@@", Integer.toString(a));
payload = payload.replace("@@@a@@@", Integer.toString(a));
int b = rand.nextInt(100);
payload.replace("@@@a@@@", Integer.toString(b));
payload = payload.replace("@@@b@@@", Integer.toString(b));
int op = rand.nextInt(3);
String[] ops = new String[] {"+", "-", "*"};
String opString = ops[op];
payload.replace("@@@a@@@", opString);
payload = payload.replace("@@@op@@@", opString);
int result = Integer.MIN_VALUE;
if (opString.equals("+"))
result = a + b;
Expand Down

0 comments on commit 066da23

Please sign in to comment.