From 7233eb71d9689e440fbd9c8100d51e64db19bc1e Mon Sep 17 00:00:00 2001 From: Geramy Loveless Date: Tue, 24 Jul 2018 21:00:52 -0700 Subject: [PATCH] Removed test from int16 removed test from int16 and created a int64 test for Add and Sub.Ovf --- .../System/Int16Test.cs | 27 ------------------- .../System/Int64Test.cs | 27 +++++++++++++++++++ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Tests/Cosmos.Compiler.Tests.Bcl/System/Int16Test.cs b/Tests/Cosmos.Compiler.Tests.Bcl/System/Int16Test.cs index 4afbe831d..9e1518494 100644 --- a/Tests/Cosmos.Compiler.Tests.Bcl/System/Int16Test.cs +++ b/Tests/Cosmos.Compiler.Tests.Bcl/System/Int16Test.cs @@ -8,7 +8,6 @@ namespace Cosmos.Compiler.Tests.Bcl.System { public static void Execute() { - bool efuse; short value; string result; string expectedResult; @@ -143,32 +142,6 @@ namespace Cosmos.Compiler.Tests.Bcl.System ByRefTestMethod(ref value); 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) diff --git a/Tests/Cosmos.Compiler.Tests.Bcl/System/Int64Test.cs b/Tests/Cosmos.Compiler.Tests.Bcl/System/Int64Test.cs index 4fad1ff6d..3d663f22e 100644 --- a/Tests/Cosmos.Compiler.Tests.Bcl/System/Int64Test.cs +++ b/Tests/Cosmos.Compiler.Tests.Bcl/System/Int64Test.cs @@ -8,6 +8,7 @@ namespace Cosmos.Compiler.Tests.Bcl.System { public static void Execute() { + bool efuse; long value; string result; string expectedResult; @@ -147,6 +148,32 @@ namespace Cosmos.Compiler.Tests.Bcl.System ByRefTestMethod(ref value); 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)