[System] Tweak socket test
[mono-project.git] / mono / tests / bug-81691.cs
blobceae90f722f5ad7c1da753a463e1576ad8a5ef0e
1 using System;
2 using System.IO;
3 using System.Reflection;
5 class Program
7 static int Main ()
9 string assemblyFile = Path.Combine (AppDomain.CurrentDomain.BaseDirectory, "bug-81691-b.dll");
10 Assembly assembly = Assembly.LoadFile (assemblyFile);
11 int i;
12 int numExceptions = 0;
14 for (i = 0; i < 100000; ++i) {
15 try {
16 try {
17 Type type = assembly.GetType ("NS.B.TestB");
18 FieldInfo field =type.GetField ("testb", BindingFlags.NonPublic | BindingFlags.Static);
19 if (field.FieldType == null)
20 return 1;
21 } catch (TypeLoadException ex) {
22 ++numExceptions;
24 } catch (FileNotFoundException ex) {
25 ++numExceptions;
29 if (numExceptions == 100000)
30 return 0;
31 return 1;