@Test public void testEqualsObjectObject() { Object obj1 = new Object(); assertTrue(cFunction.equals(obj1, obj1)); assertFalse(cFunction.equals(obj1, null)); assertFalse(cFunction.equals(null, obj1)); assertFalse(cFunction.equals(new Object(), new Object())); }
@Test public void testEqualsDoubleFloat() { // Since Java and C are not able to compare // float and double values with absolute precision -> 1.3 != 1.3F assertFalse(cFunction.equals(1.3, 1.3F)); assertTrue(cFunction.equals(1.5, 1.5F)); }
@Test public void testEqualsFloatLong() { assertTrue(cFunction.equals(1.0F, 1L)); assertFalse(cFunction.equals(1.1F, 1L)); // Since Java and C are not able to compare // float and double values with absolute precision -> 1.3F != 1.3 assertFalse(cFunction.equals(1.3F, 1.3)); }
@Test public void testSmallerEqualFloatDouble() { assertTrue(cFunction.smallerEqual(1.0F, 1.0)); assertTrue(cFunction.smallerEqual(1.5F, 1.5)); assertTrue(cFunction.smallerEqual(1.1F, 1.2)); // Since Java and C are not able to compare // float and double values with absolute precision -> 1.2 ! <= 1.2F assertFalse(cFunction.smallerEqual(1.2F, 1.2)); assertFalse(cFunction.smallerEqual(1.2F, 1.1)); }
@Test public void testEqualsEObjectEObject() { EObject obj1 = EcoreFactory.eINSTANCE.createEObject(); assertTrue(cFunction.equals(obj1, obj1)); assertFalse(cFunction.equals(obj1, null)); assertFalse(cFunction.equals(null, obj1)); assertTrue( cFunction.equals( EcoreFactory.eINSTANCE.createEObject(), EcoreFactory.eINSTANCE.createEObject())); }
@Test public void testEqualsFloatFloat() { assertTrue(cFunction.equals(1.3F, 1.3F)); assertFalse(cFunction.equals(1.31F, 1.3F)); }
@Test public void testEqualsLongDouble() { assertTrue(cFunction.equals(1L, 1D)); assertFalse(cFunction.equals(1L, 1.01D)); }
@Test public void testBitwiseOrLongInteger() { long expected = 7L; long actual = cFunction.bitwiseOr(5L, 3); assertEquals(expected, actual); }
@Test public void testNotEqualsLongLong() { assertTrue(cFunction.notEquals(1L, 2L)); assertFalse(cFunction.notEquals(1L, 1L)); }
@Test public void testNotEqualsFloatFloat() { assertTrue(cFunction.notEquals(1.2F, 1.3F)); assertFalse(cFunction.notEquals(1.1F, 1.1F)); }
@Test public void testNotEqualsStringString() { assertTrue(cFunction.notEquals("Hans", "Wurst")); assertFalse(cFunction.notEquals("Hans", "Hans")); }
@Test public void testEqualsLongInteger() { assertTrue(cFunction.equals(1L, 1)); assertFalse(cFunction.equals(1L, 2)); }
@Test public void testPlusIntegerLong() { long expected = 10; long actual = cFunction.plus(5, 5L); assertEquals(expected, actual); }
@Test public void testPlusFloatDouble() { double expected = 10.6; double actual = cFunction.plus(5.3F, 5.3); assertEquals(expected, actual, delta); }
@Test public void testPlusFloatInteger() { float expected = 10.3F; float actual = cFunction.plus(5.3F, 5); assertEquals(expected, actual, delta); }
@Test public void testEqualsStringString() { String test = "test"; assertTrue(cFunction.equals(test, "test")); assertFalse(cFunction.equals(test, "test2")); }
@Test public void testBitwiseXorIntegerInteger() { int expected = 6; int actual = cFunction.bitwiseXor(5, 3); assertEquals(expected, actual); }
@Test public void testBitwiseXorIntegerLong() { long expected = 6L; long actual = cFunction.bitwiseXor(5, 3L); assertEquals(expected, actual); }
@Test public void testEqualsDoubleInteger() { assertTrue(cFunction.equals(1.0, 1)); assertFalse(cFunction.equals(1.1, 1)); }
@Test public void testEqualsDoubleDouble() { assertTrue(cFunction.equals(1.5, 1.5)); assertFalse(cFunction.equals(1.3, 1.31)); }
@Test public void testEqualsDoubleLong() { assertTrue(cFunction.equals(1.0, 1L)); assertFalse(cFunction.equals(1.1, 1L)); }
@Test public void testEqualsLongLong() { assertTrue(cFunction.equals(10L, 10L)); assertFalse(cFunction.equals(11L, 10L)); }
@Test public void testNotEqualsBooleanBoolean() { assertTrue(cFunction.notEquals(true, false)); assertFalse(cFunction.notEquals(true, true)); }
@Test public void testEqualsIntegerDouble() { assertTrue(cFunction.equals(1, 1.0)); assertFalse(cFunction.equals(1, 1.1)); }
@Test public void testNotEqualsIntegerInteger() { assertTrue(cFunction.notEquals(1, 2)); assertFalse(cFunction.notEquals(1, 1)); }
@Test public void testEqualsIntegerLong() { assertTrue(cFunction.equals(1, 1L)); assertFalse(cFunction.equals(1, 2L)); }
@Test public void testNotEqualsDoubleDouble() { assertTrue(cFunction.notEquals(1.2, 1.3)); assertFalse(cFunction.notEquals(1.2, 1.2)); }
@Test public void testEqualsFloatInteger() { assertTrue(cFunction.equals(1.0F, 1)); assertFalse(cFunction.equals(1.1F, 1)); }
@Test public void testNotEqualsIntegerFloat() { assertTrue(cFunction.notEquals(1, 1.1F)); assertFalse(cFunction.notEquals(1, 1.0F)); }
@Test public void testEqualsLongFloat() { assertTrue(cFunction.equals(1L, 1F)); assertFalse(cFunction.equals(1L, 1.01F)); }