Skip to content

Commit

Permalink
Start work on fixing #120, first for int/long, afterburner, 2.12
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Dec 17, 2020
1 parent baea709 commit 1fdb431
Show file tree
Hide file tree
Showing 10 changed files with 1,369 additions and 321 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,34 @@ public abstract class AfterburnerTestBase extends junit.framework.TestCase

public enum ABC { A, B, C; }

protected static class BooleanWrapper {
public Boolean b;

public BooleanWrapper() { }
public BooleanWrapper(Boolean value) { b = value; }
}

protected static class IntWrapper {
public int i;

public IntWrapper() { }
public IntWrapper(int value) { i = value; }
}

protected static class LongWrapper {
public long l;

public LongWrapper() { }
public LongWrapper(long value) { l = value; }
}

protected static class DoubleWrapper {
public double d;

public DoubleWrapper() { }
public DoubleWrapper(double value) { d = value; }
}

// since 2.8
public static class Point {
public int x, y;
Expand Down Expand Up @@ -257,10 +285,26 @@ protected void verifyException(Throwable e, String... matches)
*/

public String quote(String str) {
return q(str);
}

public String q(String str) {
return '"'+str+'"';
}

protected static String aposToQuotes(String json) {
return a2q(json);
}

protected static String a2q(String json) {
return json.replace("'", "\"");
}

protected byte[] utf8Bytes(String str) {
try {
return str.getBytes("UTF-8");
} catch (IOException e) {
throw new IllegalArgumentException(e);
}
}
}
Loading

0 comments on commit 1fdb431

Please sign in to comment.