[mono-api-info] First filter, then order, and use ordinal comparison.
[mono-project.git] / mono / tests / exception18.cs
blob8f1e492c0e97bf83d09db8c33f9a95c5ae83bf8e
1 using System;
3 class C
5 static Exception e;
7 static void Throw ()
9 try {
10 int.Parse (null);
11 } catch (Exception ex) {
12 e = ex;
16 static int FrameCount (Exception ex)
18 string fullTrace = ex.StackTrace;
19 string[] frames = fullTrace.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
20 return frames.Length;
23 public static void Main ()
25 Throw ();
27 try {
28 throw e;
29 } catch (Exception ex) {
30 int frames = FrameCount (ex);
31 if (frames != 1)
32 throw new Exception (String.Format("Exception carried {0} frames along with it when it should have reported one.", frames));
35 try {
36 try {
37 int.Parse (null);
38 } catch (Exception) {
39 throw;
41 } catch (Exception ex) {
42 int frames = FrameCount (ex);
43 if (frames != 4)
44 throw new Exception (String.Format("Exception carried {0} frames along with it when it should have reported four.", frames));