Merge pull request #3528 from BrzVlad/fix-sgen-check-before-collections
[mono.git] / mcs / class / corlib / Test / System.Resources / ResourceReaderTest.cs
index 4b283671dcd5bb77fc00c8be7224fbb38683ca9f..55f00dd8bede15797ed25b02495180e54f79ccfb 100644 (file)
@@ -28,15 +28,9 @@ namespace MonoTests.System.Resources
                [TestFixtureSetUp]
                public void FixtureSetUp ()
                {
-                       char ds = Path.DirectorySeparatorChar;
-                       if (ds == '/') {
-                               string base_path = Path.Combine (Directory.GetCurrentDirectory (), Path.Combine ("Test", "resources"));
-                               m_ResourceFile = Path.Combine (base_path, "MyResources.resources");
-                               m_BadResourceFile = Path.Combine (base_path, "Empty.resources");
-                       } else {
-                               m_ResourceFile = Path.Combine ("Test", Path.Combine ("resources", "MyResources.resources"));
-                               m_BadResourceFile = "resources" + ds + "Empty.resources";
-                       }
+                       string base_path = Path.Combine (Directory.GetCurrentDirectory (), Path.Combine ("Test", "resources"));
+                       m_ResourceFile = Path.Combine (base_path, "MyResources.resources");
+                       m_BadResourceFile = Path.Combine (base_path, "Empty.resources");
                }
 
                [SetUp]
@@ -90,8 +84,8 @@ namespace MonoTests.System.Resources
                }
 
                [Test]
-               [Ignore ("Not covered in the docs, not sure what the correct behavior should be for this")]
-               [ExpectedException (typeof (DirectoryNotFoundException))]
+               [Category ("MobileNotWorking")]
+               [ExpectedException (typeof (BadImageFormatException))]
                public void ConstructorString_Bad ()
                {
                        Assert.IsTrue (File.Exists (m_BadResourceFile));
@@ -99,6 +93,7 @@ namespace MonoTests.System.Resources
                }
 
                [Test]
+               [Category ("MobileNotWorking")]
                public void ConstructorString ()
                {
                        if (!File.Exists (m_ResourceFile)) {
@@ -125,6 +120,7 @@ namespace MonoTests.System.Resources
                }
 
                [Test]
+               [Category ("MobileNotWorking")]
                public void ConstructorStream_Closed ()
                {
                        Stream stream = new FileStream (m_ResourceFile, FileMode.Open);
@@ -143,6 +139,7 @@ namespace MonoTests.System.Resources
                }
 
                [Test]
+               [Category ("MobileNotWorking")]
                public void Stream ()
                {
                        Stream stream = new FileStream (m_ResourceFile, FileMode.Open);
@@ -152,6 +149,7 @@ namespace MonoTests.System.Resources
                }
 
                [Test]
+               [Category ("MobileNotWorking")]
                public void Close ()
                {
                        Stream stream = new FileStream (m_ResourceFile, FileMode.Open);
@@ -164,6 +162,7 @@ namespace MonoTests.System.Resources
                }
 
                [Test]
+               [Category ("MobileNotWorking")]
                public void Enumerator ()
                {
                        Stream stream = new FileStream (m_ResourceFile, FileMode.Open);
@@ -181,7 +180,6 @@ namespace MonoTests.System.Resources
                        reader.Close ();
                }
 
-#if NET_2_0
                [Test] // bug #81757
                public void ReadNullResource ()
                {
@@ -203,7 +201,6 @@ namespace MonoTests.System.Resources
                                Assert.AreEqual (1, entryCount, "#4");
                        }
                }
-#endif
 
                [Test] // bug #79976
                public void ByteArray ()
@@ -212,19 +209,10 @@ namespace MonoTests.System.Resources
 
                        Stream stream = null;
 
-#if NET_2_0
                        // we currently do not support writing v2 resource files
                        stream = new MemoryStream ();
                        stream.Write (byte_resource_v2, 0, byte_resource_v2.Length);
                        stream.Position = 0;
-#else
-                       using (IResourceWriter rw = new ResourceWriter (_tempResourceFile)) {
-                               rw.AddResource ("byteArrayTest", content);
-                               rw.Generate ();
-                       }
-
-                       stream = File.OpenRead (_tempResourceFile);
-#endif
 
                        using (stream) {
                                int entryCount = 0;
@@ -239,8 +227,8 @@ namespace MonoTests.System.Resources
                        }
                }
 
-#if NET_2_0
                [Test]
+               [Category ("MobileNotWorking")]
                public void GetResourceDataNullName ()
                {
                        ResourceReader r = new ResourceReader ("Test/resources/StreamTest.resources");
@@ -262,6 +250,7 @@ namespace MonoTests.System.Resources
                }
 
                [Test]
+               [Category ("MobileNotWorking")]
                public void GetResourceData ()
                {
                        byte [] t1 = new byte [] {0x16, 0x00, 0x00, 0x00, 0x76, 0x65, 0x72, 0x69, 0x74, 0x61, 0x73, 0x20, 0x76, 0x6F, 0x73, 0x20, 0x6C, 0x69, 0x62, 0x65, 0x72, 0x61, 0x62, 0x69, 0x74, 0x0A};
@@ -293,6 +282,7 @@ namespace MonoTests.System.Resources
                }
 
                [Test]
+               [Category ("MobileNotWorking")]
                public void GetResourceData2 ()
                {
                        byte [] expected = new byte [] {
@@ -350,6 +340,5 @@ namespace MonoTests.System.Resources
                        0x00, 0x72, 0x00, 0x72, 0x00, 0x61, 0x00, 0x79, 0x00, 0x54, 0x00,
                        0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
                        0x06, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 };
-#endif
        }
 }