diff -r 3a1f262311cf -r d2a5a7a0e167 rt/emul/compacttest/src/test/java/org/apidesign/bck2brwsr/tck/LongArithmeticTest.java --- a/rt/emul/compacttest/src/test/java/org/apidesign/bck2brwsr/tck/LongArithmeticTest.java Wed Nov 19 19:32:00 2014 +0100 +++ b/rt/emul/compacttest/src/test/java/org/apidesign/bck2brwsr/tck/LongArithmeticTest.java Wed Jan 07 14:17:22 2015 +0100 @@ -38,7 +38,7 @@ private static long mul(long x, long y) { return (x * y); } - + private static long div(long x, long y) { return (x / y); } @@ -82,6 +82,14 @@ private static double dadd(double x, double y) { return x + y; } + + private static long mul64shr64(long base, int mul, int shr) { + long tmp = base * mul; + if (shr == -1) { + return tmp; + } + return tmp >> shr; + } public static int compare(long x, long y, int zero) { final int xyResult = compareL(x, y, zero); @@ -411,6 +419,21 @@ return compare(0x8000000000000000l, 0x7fffffffffffffffl, 0); } + @Compare public int intConversionProblemInRandom() { + long res = mul64shr64(16, 1561751147, 31); + return (int) res; + } + + @Compare public long shiftProblemInRandom() { + long res = mul64shr64(16, 1561751147, 31); + return res; + } + + @Compare public long multiplyProblemInRandom() { + long res = mul64shr64(16, 1561751147, -1); + return res; + } + @Factory public static Object[] create() { return VMTest.create(LongArithmeticTest.class);