Skip to content

Commit

Permalink
[tests] Remove workaround for an objc_msgSend bug that's been fixed f…
Browse files Browse the repository at this point in the history
…or a while. (dotnet#13556)

We're not executing anywhere where this bug is present anymore.
  • Loading branch information
rolfbjarne authored Dec 14, 2021
1 parent 0bd6cf0 commit bb2572f
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 273 deletions.
14 changes: 0 additions & 14 deletions tests/monotouch-test/ModelIO/MDLLight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,6 @@ public void Setup ()
{
if (!TestRuntime.CheckXcodeVersion (7, 0))
Assert.Ignore ("Requires iOS 9.0+ or macOS 10.11+");

if (
#if !MONOMAC
Runtime.Arch == Arch.SIMULATOR &&
#endif
IntPtr.Size == 4) {
// There's a bug in the i386 version of objc_msgSend where it doesn't preserve SIMD arguments
// when resizing the cache of method selectors for a type. So here we call all selectors we can
// find, so that the subsequent tests don't end up producing any cache resize (radar #21630410).
using (var obj = new MDLLight ()) {
obj.GetIrradiance (Vector3.Zero);
obj.GetIrradiance (Vector3.Zero, CGColorSpace.CreateGenericRgb ());
}
}
}

[Test]
Expand Down
44 changes: 0 additions & 44 deletions tests/monotouch-test/ModelIO/MDLMaterialProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,50 +42,6 @@ public void Setup ()

if (!TestRuntime.CheckXcodeVersion (7, 0))
Assert.Ignore ("Requires iOS 9.0+ or macOS 10.11+");

if (
#if !MONOMAC
Runtime.Arch == Arch.SIMULATOR &&
# endif
IntPtr.Size == 4) {
// There's a bug in the i386 version of objc_msgSend where it doesn't preserve SIMD arguments
// when resizing the cache of method selectors for a type. So here we call all selectors we can
// find, so that the subsequent tests don't end up producing any cache resize (radar #21630410).
object dummy;
using (var obj = new MDLMaterialProperty ("name", MDLMaterialSemantic.AmbientOcclusion)) {
dummy = obj.Color;
dummy = obj.Float2Value;
dummy = obj.Float3Value;
dummy = obj.Float4Value;
dummy = obj.FloatValue;
dummy = obj.Matrix4x4;
dummy = obj.Name;
dummy = obj.Semantic;
obj.SetProperties (new MDLMaterialProperty ("foo", MDLMaterialSemantic.AmbientOcclusion));
dummy = obj.StringValue;
dummy = obj.TextureSamplerValue;
dummy = obj.Type;
dummy = obj.UrlValue;
}
using (var obj = new MDLMaterialProperty ("name", MDLMaterialSemantic.AmbientOcclusion, Vector3.Zero)) {
}
using (var obj = new MDLMaterialProperty ("name", MDLMaterialSemantic.AmbientOcclusion, new MDLTextureSampler ())) {
}
using (var obj = new MDLMaterialProperty ("name", MDLMaterialSemantic.AmbientOcclusion, "string value")) {
}
using (var obj = new MDLMaterialProperty ("name", MDLMaterialSemantic.AmbientOcclusion, new NSUrl ("http://foo.com"))) {
}
using (var obj = new MDLMaterialProperty ("name", MDLMaterialSemantic.AmbientOcclusion, Matrix4.Identity)) {
}
using (var obj = new MDLMaterialProperty ("name", MDLMaterialSemantic.AmbientOcclusion, Vector4.Zero)) {
}
using (var obj = new MDLMaterialProperty ("name", MDLMaterialSemantic.AmbientOcclusion, UIColor.Black.CGColor)) {
}
using (var obj = new MDLMaterialProperty ("name", MDLMaterialSemantic.AmbientOcclusion, Vector2.Zero)) {
}
using (var obj = new MDLMaterialProperty ("name", MDLMaterialSemantic.AmbientOcclusion, 1.23f)) {
}
}
}


Expand Down
48 changes: 0 additions & 48 deletions tests/monotouch-test/ModelIO/MDLMesh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,54 +30,6 @@ public class MDLMeshTest {
public void Setup ()
{
TestRuntime.AssertXcodeVersion (7, 0);

#if !MONOMAC
if (Runtime.Arch == Arch.SIMULATOR && IntPtr.Size == 4) {
// There's a bug in the i386 version of objc_msgSend where it doesn't preserve SIMD arguments
// when resizing the cache of method selectors for a type. So here we call all selectors we can
// find, so that the subsequent tests don't end up producing any cache resize (radar #21630410).
object dummy;
using (var obj = MDLMesh.CreateBox (Vector3.Zero, Vector3i.Zero, MDLGeometryType.Triangles, true, null)) {
obj.AddAttribute ("foo", MDLVertexFormat.Char);
// obj.AddNormals (null, 0); // throws NSInvalidArgumentException, need to figure out valid arguments
// obj.AddTangentBasis ("foo", "bar", "zap"); // throws "Need float or half UV components Need float or half UV components"
// obj.AddTangentBasisWithNormals ("foo", "bar", "zap"); // throws "Need float or half UV components Reason: Need float or half UV components"
dummy = obj.BoundingBox;
// obj.GenerateAmbientOcclusionTexture (1, 1, new MDLObject [] { }, "name", "name");
// obj.GenerateAmbientOcclusionVertexColors (1, 1, new MDLObject[] {}, "name");
// obj.GenerateAmbientOcclusionVertexColors (1.1, 1, new MDLObject[] [] { }, "name");
// obj.GenerateLightMapTexture (Vector2i.Zero, new MDLLight[] {}, new MDLObject[] {}, "str", "str");
// obj.GenerateLightMapVertexColors (new MDLLight[] { }, new MDLObject[] { }, "v");
obj.MakeVerticesUnique ();
dummy = obj.Submeshes;
dummy = obj.VertexBuffers;
dummy = obj.VertexCount;
dummy = obj.VertexDescriptor;
}

using (var obj = MDLMesh.CreateCylindroid (1, Vector2.Zero, 3, 0, MDLGeometryType.Triangles, false, null)) {
}
using (var obj = MDLMesh.CreateEllipsoid (Vector3.Zero, 3, 2, MDLGeometryType.Triangles, false, false, null)) {
}
using (var obj = MDLMesh.CreateEllipticalCone (0, Vector2.Zero, 3, 1, MDLGeometryType.Triangles, false, null)) {
}
using (var obj = MDLMesh.CreateIcosahedron (0, false, null)) {
}
using (var obj = MDLMesh.CreatePlane (new Vector2 (1, 1), new Vector2i (1, 1), MDLGeometryType.Triangles, null)) {
}
using (var obj = MDLMesh.CreateSphere (new Vector3 (1, 2, 3), new Vector2i (4, 5), MDLGeometryType.Triangles, true, null)) {
}
using (var obj = MDLMesh.CreateHemisphere (new Vector3 (1, 2, 3), new Vector2i (4, 5), MDLGeometryType.Triangles, true, true, null)) {
}
using (var obj = MDLMesh.CreateCapsule (new Vector3 (1, 2, 3), new Vector2i (4, 5), MDLGeometryType.Triangles, true, 10, null)) {
}
using (var obj = MDLMesh.CreateCone (new Vector3 (1, 2, 3), new Vector2i (4, 5), MDLGeometryType.Triangles, true, true, null)) {
}
// using (var obj = MDLMesh.CreateSubdividedMesh (new MDLMesh (), 0, 0)) {
// }

}
#endif
}

[Test]
Expand Down
24 changes: 0 additions & 24 deletions tests/monotouch-test/ModelIO/MDLNoiseTexture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,6 @@ public class MDLNoiseTextureTest
public void Setup ()
{
TestRuntime.AssertXcodeVersion (8, 2);

#if !MONOMAC
if (Runtime.Arch == Arch.SIMULATOR && IntPtr.Size == 4) {
// There's a bug in the i386 version of objc_msgSend where it doesn't preserve SIMD arguments
// when resizing the cache of method selectors for a type. So here we call all selectors we can
// find, so that the subsequent tests don't end up producing any cache resize (radar #21630410).
object dummy;
using (var obj = new MDLNoiseTexture (1.0f, "texture", Vector2i.Zero, MDLTextureChannelEncoding.Float16)) {
dummy = obj.ChannelCount;
dummy = obj.ChannelEncoding;
dummy = obj.Dimensions;
dummy = obj.IsCube;
dummy = obj.MipLevelCount;
dummy = obj.Name;
dummy = obj.RowStride;
obj.GetTexelDataWithBottomLeftOrigin ();
obj.GetTexelDataWithBottomLeftOrigin (1, false);
obj.GetTexelDataWithTopLeftOrigin ();
obj.GetTexelDataWithTopLeftOrigin (1, false);
}
using (var obj = new MDLTexture ()) {
}
}
#endif
}

[Test]
Expand Down
19 changes: 0 additions & 19 deletions tests/monotouch-test/ModelIO/MDLObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,6 @@ public void Setup ()
{
if (!TestRuntime.CheckXcodeVersion (7, 0))
Assert.Ignore ("Requires iOS 9.0+ or macOS 10.11+");

if (
#if !MONOMAC
Runtime.Arch == Arch.SIMULATOR &&
#endif
IntPtr.Size == 4) {
// There's a bug in the i386 version of objc_msgSend where it doesn't preserve SIMD arguments
// when resizing the cache of method selectors for a type. So here we call all selectors we can
// find, so that the subsequent tests don't end up producing any cache resize (radar #21630410).
using (var obj = new MDLObject ()) {
object dummy;
obj.SetComponent (new MDLTransform (), new Protocol ("MDLComponent"));
obj.IsComponentConforming (new Protocol ("MDLComponent"));
dummy = obj.Parent;
dummy = obj.Transform;
obj.AddChild (new MDLObject ());
obj.GetBoundingBox (0);
}
}
}

[Test]
Expand Down
26 changes: 0 additions & 26 deletions tests/monotouch-test/ModelIO/MDLTexture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,6 @@ public class MDLTextureTest {
public void Setup ()
{
TestRuntime.AssertXcodeVersion (7, 0);

if (
#if !MONOMAC
Runtime.Arch == Arch.SIMULATOR &&
#endif
IntPtr.Size == 4) {
// There's a bug in the i386 version of objc_msgSend where it doesn't preserve SIMD arguments
// when resizing the cache of method selectors for a type. So here we call all selectors we can
// find, so that the subsequent tests don't end up producing any cache resize (radar #21630410).
object dummy;
using (var obj = new MDLTexture (null, true, null, Vector2i.Zero, 12, 2, MDLTextureChannelEncoding.Float16, false)) {
dummy = obj.ChannelCount;
dummy = obj.ChannelEncoding;
dummy = obj.Dimensions;
dummy = obj.IsCube;
dummy = obj.MipLevelCount;
dummy = obj.Name;
dummy = obj.RowStride;
obj.GetTexelDataWithBottomLeftOrigin ();
obj.GetTexelDataWithBottomLeftOrigin (1, false);
obj.GetTexelDataWithTopLeftOrigin ();
obj.GetTexelDataWithTopLeftOrigin (1, false);
}
using (var obj = new MDLTexture ()) {
}
}
}

[Test]
Expand Down
27 changes: 0 additions & 27 deletions tests/monotouch-test/ModelIO/MDLTransform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,33 +40,6 @@ public void Setup ()
{
if (!TestRuntime.CheckXcodeVersion (7, 0))
Assert.Ignore ("Requires iOS 9.0+ or macOS 10.11+");

if (
#if !MONOMAC
Runtime.Arch == Arch.SIMULATOR &&
#endif
IntPtr.Size == 4) {
// There's a bug in the i386 version of objc_msgSend where it doesn't preserve SIMD arguments
// when resizing the cache of method selectors for a type. So here we call all selectors we can
// find, so that the subsequent tests don't end up producing any cache resize (radar #21630410).
object dummy;
using (var obj = new MDLTransform (Matrix4.Identity)) {
dummy = obj.Matrix;
dummy = obj.MaximumTime;
dummy = obj.MinimumTime;
dummy = obj.Rotation;
obj.GetRotation (0);
dummy = obj.Scale;
obj.GetScale (0);
obj.SetIdentity ();
obj.SetLocalTransform (Matrix4.Identity);
obj.SetRotation (Vector3.Zero, 0);
obj.SetScale (Vector3.Zero, 0);
obj.SetTranslation (Vector3.Zero, 0);
dummy = obj.Translation;
obj.GetTranslation (0);
}
}
}

[Test]
Expand Down
18 changes: 0 additions & 18 deletions tests/monotouch-test/ModelIO/MDLVertexAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,6 @@ public void Setup ()
{
if (!TestRuntime.CheckXcodeVersion (7, 0))
Assert.Ignore ("Requires iOS 9.0+ or macOS 10.11+");

if (
#if !MONOMAC
Runtime.Arch == Arch.SIMULATOR &&
#endif
IntPtr.Size == 4) {
// There's a bug in the i386 version of objc_msgSend where it doesn't preserve SIMD arguments
// when resizing the cache of method selectors for a type. So here we call all selectors we can
// find, so that the subsequent tests don't end up producing any cache resize (radar #21630410).
object dummy;
using (var obj = new MDLVertexAttribute ()) {
dummy = obj.BufferIndex;
dummy = obj.Format;
dummy = obj.InitializationValue;
dummy = obj.Name;
dummy = obj.Offset;
}
}
}

[Test]
Expand Down
16 changes: 0 additions & 16 deletions tests/monotouch-test/SpriteKit/SK3DNodeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ public void ProjectPoint ()
GC.KeepAlive (Class.GetHandle (typeof(SCNRenderer)));

using (var node = new SK3DNode ()) {
#if !MONOMAC
if (Runtime.Arch == Arch.SIMULATOR && IntPtr.Size == 4) {
// 32-bit simulator returns 0,0,0 the first time
// this is executed for some reason, so just
// ignore that.
node.ProjectPoint (new Vector3 (4, 5, 6));
}
#endif
var v = node.ProjectPoint (new Vector3 (1, 2, 3));
Assert.AreEqual (1, v.X, "#x1");
Assert.AreEqual (2, v.Y, "#y1");
Expand All @@ -61,14 +53,6 @@ public void UnprojectPoint ()
#endif

using (var node = new SK3DNode ()) {
#if !MONOMAC
if (Runtime.Arch == Arch.SIMULATOR && IntPtr.Size == 4) {
// 32-bit simulator returns 0,0,0 the first time
// this is executed for some reason, so just
// ignore that.
node.UnprojectPoint (new Vector3 (4, 5, 6));
}
#endif
var v = node.UnprojectPoint (new Vector3 (1, 2, 3));
Assert.AreEqual (1, v.X, "#x1");
Assert.AreEqual (2, v.Y, "#y1");
Expand Down
37 changes: 0 additions & 37 deletions tests/monotouch-test/SpriteKit/UniformTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,43 +27,6 @@ public class UniformTest
public void Setup ()
{
TestRuntime.AssertXcodeVersion (8, 0);

#if !MONOMAC
if (Runtime.Arch == Arch.SIMULATOR && IntPtr.Size == 4) {
// There's a bug in the i386 version of objc_msgSend where it doesn't preserve SIMD arguments
// when resizing the cache of method selectors for a type. So here we call all selectors we can
// find, so that the subsequent tests don't end up producing any cache resize (radar #21630410).
object dummy;
using (var obj = new SKUniform ("name")) {
dummy = obj.Name;
dummy = obj.UniformType;
dummy = obj.TextureValue;
dummy = obj.FloatValue;
dummy = obj.FloatVector2Value;
dummy = obj.FloatVector3Value;
dummy = obj.FloatVector4Value;
dummy = obj.FloatMatrix2Value;
dummy = obj.FloatMatrix3Value;
dummy = obj.FloatMatrix4Value;
}
using (var obj = new SKUniform ("name", SKTexture.FromImageNamed ("basn3p08.png"))) {
}
using (var obj = new SKUniform ("name", 1.0f)) {
}
using (var obj = new SKUniform ("name", Vector2.Zero)) {
}
using (var obj = new SKUniform ("name", Vector3.Zero)) {
}
using (var obj = new SKUniform ("name", Vector4.Zero)) {
}
using (var obj = new SKUniform ("name", Matrix2.Identity)) {
}
using (var obj = new SKUniform ("name", Matrix3.Identity)) {
}
using (var obj = new SKUniform ("name", Matrix4.Identity)) {
}
}
#endif
}

[Test]
Expand Down

0 comments on commit bb2572f

Please sign in to comment.