2014-08-13 10:39:27 +01:00
|
|
|
// Compiler options: -linkresource:test-513.cs -linkresource:test-512.cs -linkresource:./test-511.cs,test
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.IO;
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
|
|
public class Test
|
|
|
|
{
|
|
|
|
public static int Main ()
|
|
|
|
{
|
|
|
|
Assembly a = Assembly.GetExecutingAssembly ();
|
|
|
|
string[] resourceNames = a.GetManifestResourceNames ();
|
|
|
|
if (resourceNames.Length != 3)
|
|
|
|
return 1;
|
|
|
|
if (resourceNames[0] != "test-513.cs")
|
2016-02-22 11:00:01 -05:00
|
|
|
return 2;
|
2014-08-13 10:39:27 +01:00
|
|
|
if (resourceNames[1] != "test-512.cs")
|
2016-02-22 11:00:01 -05:00
|
|
|
return 3;
|
2014-08-13 10:39:27 +01:00
|
|
|
if (resourceNames[2] != "test")
|
2016-02-22 11:00:01 -05:00
|
|
|
return 4;
|
2014-08-13 10:39:27 +01:00
|
|
|
FileStream f = a.GetFile ("test-513.cs");
|
|
|
|
if (f == null)
|
2016-02-22 11:00:01 -05:00
|
|
|
return 5;
|
2014-08-13 10:39:27 +01:00
|
|
|
f = a.GetFile ("test-512.cs");
|
|
|
|
if (f == null)
|
2016-02-22 11:00:01 -05:00
|
|
|
return 6;
|
2014-08-13 10:39:27 +01:00
|
|
|
f = a.GetFile ("test-511.cs");
|
|
|
|
if (f == null)
|
2016-02-22 11:00:01 -05:00
|
|
|
return 7;
|
2014-08-13 10:39:27 +01:00
|
|
|
f = a.GetFile ("test");
|
|
|
|
if (f != null)
|
2016-02-22 11:00:01 -05:00
|
|
|
return 8;
|
2014-08-13 10:39:27 +01:00
|
|
|
Stream s = a.GetManifestResourceStream ("test-513.cs");
|
|
|
|
if (s == null)
|
2016-02-22 11:00:01 -05:00
|
|
|
return 9;
|
2014-08-13 10:39:27 +01:00
|
|
|
s = a.GetManifestResourceStream ("test-512.cs");
|
|
|
|
if (s == null)
|
2016-02-22 11:00:01 -05:00
|
|
|
return 10;
|
2014-08-13 10:39:27 +01:00
|
|
|
s = a.GetManifestResourceStream ("test");
|
|
|
|
if (s == null)
|
2016-02-22 11:00:01 -05:00
|
|
|
return 11;
|
2014-08-13 10:39:27 +01:00
|
|
|
s = a.GetManifestResourceStream ("test-511.cs");
|
|
|
|
if (s != null)
|
2016-02-22 11:00:01 -05:00
|
|
|
return 12;
|
2014-08-13 10:39:27 +01:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|