fixed tests

This commit is contained in:
Dmitry Jemerov
2011-04-21 15:47:20 +02:00
parent eb7ac0cf91
commit 806bddb80c
@@ -34,15 +34,17 @@ public class PrimitiveTypesTest extends CodegenTestCase {
} }
public void testNE() throws Exception { public void testNE() throws Exception {
final String code = "fun foo(a: Int, b: Int): Int = if (a != b) 1 else 0"; loadText("fun foo(a: Int, b: Int): Int = if (a != b) 1 else 0");
binOpTest(code, 5, 5, 0); final Method main = generateFunction();
binOpTest(code, 5, 3, 1); assertEquals(0, main.invoke(null, 5, 5));
assertEquals(1, main.invoke(null, 5, 3));
} }
public void testGE() throws Exception { public void testGE() throws Exception {
final String code = "fun foo(a: Int, b: Int): Int = if (a >= b) 1 else 0"; loadText("fun foo(a: Int, b: Int): Int = if (a >= b) 1 else 0");
binOpTest(code, 5, 5, 1); final Method main = generateFunction();
binOpTest(code, 3, 5, 0); assertEquals(1, main.invoke(null, 5, 5));
assertEquals(0, main.invoke(null, 3, 5));
} }
public void testReturnCmp() throws Exception { public void testReturnCmp() throws Exception {