Revert "Added tests for div and rem for int64 operands."

This reverts commit 82871710f7.
This commit is contained in:
Quajak 2018-03-20 16:09:49 +01:00
parent 493e043742
commit 7dfd5c8d91

View file

@ -43,7 +43,7 @@ namespace Cosmos.Compiler.Tests.Bcl.System
#if false
// Now let's try ToString() again but printed in hex (this test fails for now!)
// Now let's try ToString() again but printed in hex (this test fails for now!)
result = value.ToString("X2");
expectedResult = "0x7FFFFFFFFFFFFFFF";
@ -74,24 +74,6 @@ namespace Cosmos.Compiler.Tests.Bcl.System
val2 = value << 0x02; // low-order bits: val2 = value << 0b0000_0010 = 0b0011_0000
Assert.IsTrue(val2 == 0x30, "Int64 right shift doesn't work got: " + val2);
/* Let's test right shift */
value = 4631166901565532406;
val2 = value >> 20;
Assert.IsTrue(val2 == 4416624929013, "Int64 right shift doesn't work");
val2 = value >> 52;
Assert.IsTrue(val2 == 1028, "Int64 right shift (count >=32) doesn't work");
/* ... and now left shift */
value = 4631166901565532406;
val2 = value << 20;
Assert.IsTrue(val2 == 6640827866535690240, "Int64 left shift doesn't work got " + val2);
val2 = value << 52;
Assert.IsTrue(val2 == -8115486528521633792, "Int64 left shift (count >=32) doesn't work got " + val2);
// basic arithmetic operations
value = 60;
@ -111,43 +93,6 @@ namespace Cosmos.Compiler.Tests.Bcl.System
val2 = value % 7;
Assert.IsTrue(val2 == 4, "Int64 remainder doesn't work got: " + val2);
value = 1728000000000;
val2 = value + 36000000000;
Assert.IsTrue(val2 == 1764000000000, "Int64 addition doesn't work got " + val2);
val2 = value - 36000000000;
Assert.IsTrue(val2 == 1692000000000, "Int64 subtraction doesn't work got " + val2);
val2 = value * 36000000000;
Assert.IsTrue(val2 == 5578983451391950848, "Int64 multiplication doesn't work got " + val2);
val2 = value / 36000000000;
Assert.IsTrue(val2 == 48, "Int64 division doesn't work got " + val2);
val2 = value / -36000000000;
Assert.IsTrue(val2 == -48, "Int64 division doesn't work got " + val2);
val2 = -value / 36000000000;
Assert.IsTrue(val2 == -48, "Int64 division doesn't work got " + val2);
val2 = -value / -36000000000;
Assert.IsTrue(val2 == 48, "Int64 division doesn't work got " + val2);
value = 3200000000000;
val2 = value % 1300000000000;
Assert.IsTrue(val2 == 600000000000, "Int64 remainder doesn't work got " + val2);
val2 = value % -1300000000000;
Assert.IsTrue(val2 == 600000000000, "Int64 remainder doesn't work got " + val2);
val2 = -value % 1300000000000;
Assert.IsTrue(val2 == -600000000000, "Int64 remainder doesn't work got " + val2);
val2 = -value % -1300000000000;
Assert.IsTrue(val2 == -600000000000, "Int64 remainder doesn't work got " + val2);
// Now test conversions
long maxValue = Int64.MaxValue;
@ -196,8 +141,6 @@ namespace Cosmos.Compiler.Tests.Bcl.System
Assert.IsTrue((double)minValue == Int64.MinValue, "Conv_R8 for Int64 doesn't work");
// Test Methods
value = 60;
val2 = TestMethod(value);
Assert.IsTrue(value == 60, "Passing an Int64 as a method parameter doesn't work");
Assert.IsTrue(val2 == 61, "Returning an Int64 value from a method doesn't work");