From 259b0793201f59d6279205c0de67b236c1030a01 Mon Sep 17 00:00:00 2001 From: Frederik Carlier Date: Wed, 20 Sep 2017 21:12:58 +0200 Subject: [PATCH] Remove duplicate tests, fix typo Commit migrated from https://github.com/dotnet/corefx/commit/d284084addaee43add43a0a31272352eb25aeb11 --- .../tests/Imaging/MetafileTests.cs | 7 +-- .../tests/mono/System.Imaging/MetafileTest.cs | 69 +--------------------- 2 files changed, 4 insertions(+), 72 deletions(-) diff --git a/src/libraries/System.Drawing.Common/tests/Imaging/MetafileTests.cs b/src/libraries/System.Drawing.Common/tests/Imaging/MetafileTests.cs index 145eaf0..21a33ee 100644 --- a/src/libraries/System.Drawing.Common/tests/Imaging/MetafileTests.cs +++ b/src/libraries/System.Drawing.Common/tests/Imaging/MetafileTests.cs @@ -131,7 +131,6 @@ namespace System.Drawing.Imaging.Tests yield return new object[] { EmfType.EmfPlusOnly }; } - [ActiveIssue(20884, TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.GdiplusIsAvailable)] [MemberData(nameof(EmfType_TestData))] public void Ctor_IntPtrEmfType_Success(EmfType emfType) @@ -152,7 +151,6 @@ namespace System.Drawing.Imaging.Tests yield return new object[] { (EmfType)int.MinValue }; } - [ActiveIssue(20884, TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.GdiplusIsAvailable)] [MemberData(nameof(EmfType_Invalid_TestData))] public void Ctor_IntPtrInvalidEmfType_ThrowsArgumentException(EmfType emfType) @@ -389,7 +387,6 @@ namespace System.Drawing.Imaging.Tests File.Delete(fileName); } - [ActiveIssue(20884, TestPlatforms.AnyUnix)] [ConditionalTheory(Helpers.GdiplusIsAvailable)] [MemberData(nameof(EmfType_TestData))] public void Ctor_StringIntPtrEmfType_Success(EmfType emfType) @@ -918,7 +915,6 @@ namespace System.Drawing.Imaging.Tests } } - [ActiveIssue(20884, TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.GdiplusIsAvailable)] public void Static_GetMetafileHeader_String_ReturnsExpected() { @@ -978,7 +974,6 @@ namespace System.Drawing.Imaging.Tests } } - [ActiveIssue(20884, TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.GdiplusIsAvailable)] public void GetMetafileHeader_ReturnsExpected() { @@ -987,7 +982,7 @@ namespace System.Drawing.Imaging.Tests MetafileHeader headerA = metafile.GetMetafileHeader(); MetafileHeader headerB = metafile.GetMetafileHeader(); AssertMetafileHeader(headerA); - Assert.False(ReferenceEquals(headerA, headerB)); + Assert.NotSame(headerA, headerB); } } diff --git a/src/libraries/System.Drawing.Common/tests/mono/System.Imaging/MetafileTest.cs b/src/libraries/System.Drawing.Common/tests/mono/System.Imaging/MetafileTest.cs index 64a8d0f..f58f13d 100644 --- a/src/libraries/System.Drawing.Common/tests/mono/System.Imaging/MetafileTest.cs +++ b/src/libraries/System.Drawing.Common/tests/mono/System.Imaging/MetafileTest.cs @@ -99,19 +99,6 @@ namespace MonoTests.System.Drawing.Imaging } [ConditionalFact(Helpers.GdiplusIsAvailable)] - public void GetMetafileHeader_WmfPlaceable() - { - using (Metafile mf = new Metafile(Helpers.GetTestBitmapPath(WmfPlaceable))) - { - MetafileHeader header1 = mf.GetMetafileHeader(); - Check_MetafileHeader_WmfPlaceable(header1); - - MetafileHeader header2 = mf.GetMetafileHeader(); - Assert.NotSame(header1, header2)); - } - } - - [ConditionalFact(Helpers.GdiplusIsAvailable)] public void GetMetafileHeader_FromFile_WmfPlaceable() { using (Metafile mf = new Metafile(Helpers.GetTestBitmapPath(WmfPlaceable))) @@ -123,7 +110,7 @@ namespace MonoTests.System.Drawing.Imaging Check_MetaHeader_WmfPlaceable(mh1); MetaHeader mh2 = mf.GetMetafileHeader().WmfHeader; - Assert.NotSame(mh1, mh2)); + Assert.NotSame(mh1, mh2); } } @@ -140,7 +127,7 @@ namespace MonoTests.System.Drawing.Imaging Check_MetaHeader_WmfPlaceable(mh1); MetaHeader mh2 = mf.GetMetafileHeader().WmfHeader; - Assert.NotSame(mh1, mh2)); + Assert.NotSame(mh1, mh2); } } @@ -158,7 +145,7 @@ namespace MonoTests.System.Drawing.Imaging Check_MetaHeader_WmfPlaceable(mh1); MetaHeader mh2 = mf.GetMetafileHeader().WmfHeader; - Assert.NotSame(mh1, mh2)); + Assert.NotSame(mh1, mh2); } } @@ -216,14 +203,6 @@ namespace MonoTests.System.Drawing.Imaging Check_MetafileHeader_Emf(header1); } } - - [ConditionalFact(Helpers.GdiplusIsAvailable)] - public void Static_GetMetafileHeader_Filename() - { - string filename = Helpers.GetTestBitmapPath(WmfPlaceable); - MetafileHeader header = Metafile.GetMetafileHeader(filename); - Check_MetafileHeader_WmfPlaceable(header); - } } public class MetafileFulltrustTest @@ -274,30 +253,6 @@ namespace MonoTests.System.Drawing.Imaging } [ConditionalFact(Helpers.GdiplusIsAvailable)] - public void Metafile_IntPtrEmfType_Invalid() - { - Assert.Throws(() => Metafile_IntPtrEmfType((EmfType)Int32.MinValue)); - } - - [ConditionalFact(Helpers.GdiplusIsAvailable)] - public void Metafile_IntPtrEmfType_EmfOnly() - { - Metafile_IntPtrEmfType(EmfType.EmfOnly); - } - - [ConditionalFact(Helpers.GdiplusIsAvailable)] - public void Metafile_IntPtrEmfType_EmfPlusDual() - { - Metafile_IntPtrEmfType(EmfType.EmfPlusDual); - } - - [ConditionalFact(Helpers.GdiplusIsAvailable)] - public void Metafile_IntPtrEmfType_EmfPlusOnly() - { - Metafile_IntPtrEmfType(EmfType.EmfPlusOnly); - } - - [ConditionalFact(Helpers.GdiplusIsAvailable)] public void Metafile_IntPtrRectangle_Empty() { using (Bitmap bmp = new Bitmap(10, 10, PixelFormat.Format32bppArgb)) @@ -436,24 +391,6 @@ namespace MonoTests.System.Drawing.Imaging } [ConditionalFact(Helpers.GdiplusIsAvailable)] - public void CreateFilename_MultipleGraphics_EmfOnly() - { - Assert.Throws(() => CreateFilename(EmfType.EmfOnly, false)); - } - - [ConditionalFact(Helpers.GdiplusIsAvailable)] - public void CreateFilename_MultipleGraphics_EmfPlusDual() - { - Assert.Throws(() => CreateFilename(EmfType.EmfPlusDual, false)); - } - - [ConditionalFact(Helpers.GdiplusIsAvailable)] - public void CreateFilename_MultipleGraphics_EmfPlusOnly() - { - Assert.Throws(() => CreateFilename(EmfType.EmfPlusOnly, false)); - } - - [ConditionalFact(Helpers.GdiplusIsAvailable)] public void Measure() { Font test_font = new Font(FontFamily.GenericMonospace, 12); -- 2.7.4