Add another test
authorMiguel de Icaza <miguel@gnome.org>
Mon, 8 Jul 2002 23:07:41 +0000 (23:07 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Mon, 8 Jul 2002 23:07:41 +0000 (23:07 -0000)
svn path=/trunk/mcs/; revision=5661

mcs/tests/makefile
mcs/tests/test-141.cs [new file with mode: 0755]

index db421f6bdef45ecac2de9e7b11b3a51aa36b058c..ec1f00436eeb80d471b3303c1ad7f095b4701391 100755 (executable)
@@ -22,7 +22,8 @@ TEST_SOURCES = \
        test-101 test-102 test-103 test-104 test-105 test-106 test-107 test-108 test-109 test-110\
        test-111 test-112 test-113 test-114 test-115 test-116 test-117 test-118 test-119 \
        test-121 test-122 test-123          test-125 test-126 test-127 test-128 test-129 test-130 \
-       test-131 test-132 test-133 test-134 test-135 test-136 test-137 test-138 test-139 test-140
+       test-131 test-132 test-133 test-134 test-135 test-136 test-137 test-138 test-139 test-140 \
+       test-141
 
 UNSAFE_SOURCES = \
        unsafe-1 unsafe-2 unsafe-3
diff --git a/mcs/tests/test-141.cs b/mcs/tests/test-141.cs
new file mode 100755 (executable)
index 0000000..a540037
--- /dev/null
@@ -0,0 +1,25 @@
+using System;
+
+class X {
+       public static int Main()
+       {
+               byte num1 = 105;
+               byte num2 = 150;
+               byte sum;
+
+               bool ok = false;
+               
+               // should generate OverflowException
+               try {
+                       checked {
+                               sum = (byte) (num1 - num2);
+                       }
+               } catch (OverflowException){
+                       ok = true;
+               }
+
+               if (ok)
+                       return 0;
+               return 1;
+       }
+}