Removed test from int16

removed test from int16 and created a int64 test for Add and Sub.Ovf
This commit is contained in:
Geramy Loveless 2018-07-24 21:00:52 -07:00
parent c157317889
commit 7233eb71d9
2 changed files with 27 additions and 27 deletions

View file

@ -8,7 +8,6 @@ namespace Cosmos.Compiler.Tests.Bcl.System
{ {
public static void Execute() public static void Execute()
{ {
bool efuse;
short value; short value;
string result; string result;
string expectedResult; string expectedResult;
@ -143,32 +142,6 @@ namespace Cosmos.Compiler.Tests.Bcl.System
ByRefTestMethod(ref value); ByRefTestMethod(ref value);
Assert.IsTrue(value == 61, "Passing an Int16 by ref to a method doesn't work"); Assert.IsTrue(value == 61, "Passing an Int16 by ref to a method doesn't work");
//Test StackOverflow Exceptions
short val3o;
efuse = false;
val3o = 10000;
try
{
val3o += 32767;
}
catch (StackOverflowException e)
{
efuse = true;
}
Assert.IsTrue(efuse == false, "Add_Ovf for Int16 doesn't work");
efuse = false;
val3o = -10000;
try
{
val3o -= 32767;
}
catch (StackOverflowException e)
{
efuse = true;
}
Assert.IsTrue(efuse == false, "Sub_Ovf for Int16 doesn't work");
} }
public static short TestMethod(short aParam) public static short TestMethod(short aParam)

View file

@ -8,6 +8,7 @@ namespace Cosmos.Compiler.Tests.Bcl.System
{ {
public static void Execute() public static void Execute()
{ {
bool efuse;
long value; long value;
string result; string result;
string expectedResult; string expectedResult;
@ -147,6 +148,32 @@ namespace Cosmos.Compiler.Tests.Bcl.System
ByRefTestMethod(ref value); ByRefTestMethod(ref value);
Assert.IsTrue(value == 61, "Passing an Int64 by ref to a method doesn't work"); Assert.IsTrue(value == 61, "Passing an Int64 by ref to a method doesn't work");
//Test StackOverflow Exceptions
long val3o;
efuse = false;
val3o = 1000000;
try
{
val3o += long.MaxValue;
}
catch (StackOverflowException e)
{
efuse = true;
}
Assert.IsTrue(efuse == false, "Add_Ovf for Int16 doesn't work");
efuse = false;
val3o = -10000;
try
{
val3o -= long.MaxValue;
}
catch (StackOverflowException e)
{
efuse = true;
}
Assert.IsTrue(efuse == false, "Sub_Ovf for Int16 doesn't work");
} }
public static long TestMethod(long aParam) public static long TestMethod(long aParam)