2010-06-21 Atsushi Enomoto <atsushi@ximian.com>
[mcs.git] / tests / test-513.cs
blob6ae3e9f366c40e438e847e1cb27fe8d8e679eb1d
1 // Compiler options: -linkresource:test-513.cs -linkresource:test-512.cs -linkresource:./test-511.cs,test
3 using System;
4 using System.IO;
5 using System.Reflection;
7 public class Test
9 static int Main ()
11 Assembly a = Assembly.GetExecutingAssembly ();
12 string[] resourceNames = a.GetManifestResourceNames ();
13 if (resourceNames.Length != 3)
14 return 1;
15 if (resourceNames[0] != "test-513.cs")
16 return 1;
17 if (resourceNames[1] != "test-512.cs")
18 return 1;
19 if (resourceNames[2] != "test")
20 return 1;
21 FileStream f = a.GetFile ("test-513.cs");
22 if (f == null)
23 return 1;
24 f = a.GetFile ("test-512.cs");
25 if (f == null)
26 return 1;
27 f = a.GetFile ("test-511.cs");
28 if (f == null)
29 return 1;
30 f = a.GetFile ("test");
31 if (f != null)
32 return 1;
33 Stream s = a.GetManifestResourceStream ("test-513.cs");
34 if (s == null)
35 return 1;
36 s = a.GetManifestResourceStream ("test-512.cs");
37 if (s == null)
38 return 1;
39 s = a.GetManifestResourceStream ("test");
40 if (s == null)
41 return 1;
42 s = a.GetManifestResourceStream ("test-511.cs");
43 if (s != null)
44 return 1;
46 return 0;