xamarin-macios/tests/monotouch-test/Metal
Sebastien Pouliot 5db30f619e [metal] Fix MTLHeapDescriptor and test it only on devices (#782)
It turns out `MTLHeapDescriptor` does not exists on the simulator.

```Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_MTLHeapDescriptor", referenced from:
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64```

A `[DisableDefaultCtor]` was used (by mistake / lack of documentation)
and this was hiding the issue (on our bots).

However on device introspection was not happy:

iOSApiSelectorTest
[FAIL] Selector not found for Metal.MTLHeapDescriptor : cpuCacheMode
[FAIL] Selector not found for Metal.MTLHeapDescriptor : setCpuCacheMode:
[FAIL] Selector not found for Metal.MTLHeapDescriptor : size
[FAIL] Selector not found for Metal.MTLHeapDescriptor : setSize:
[FAIL] Selector not found for Metal.MTLHeapDescriptor : storageMode
[FAIL] Selector not found for Metal.MTLHeapDescriptor : setStorageMode:
    [FAIL] iOSApiSelectorTest.ApiSelectorTest.InstanceMethods :   6 errors found in 18339 instance selector validated

Note that these are the properties, not the `init` that's mentioned here.

So first `init` is possible, on devices, from Xcode:

	MTLHeapDescriptor *hd = [[MTLHeapDescriptor alloc] init];
	NSLog (@"%@", [hd description]);

gives

	<MTLHeapDescriptorInternal: 0x17401da50>
	{
		cpuCacheMode = MTLCPUCacheModeDefaultCache;
		size = 0;
		storageMode = MTLStorageModePrivate;
		}

so we need to remove our `[DisableDefaultCtor]`.

That does not fix the selectors above... but note the *Internal type
returned, they are forwarded and that's generally something that
respondToSelector (that introspection uses) does not cover.

But, to be sure, we add unit tests showing all the properties are
working like expected :-)
2016-09-07 08:03:14 -04:00
..
ClearValueTest.cs [tests] Import 2016-05-26 15:06:52 +02:00
DeviceTest.cs Fix monotouch-tests failures on older iOS versions (#401) 2016-07-14 22:00:52 -04:00
HeapDescriptorTest.cs [metal] Fix MTLHeapDescriptor and test it only on devices (#782) 2016-09-07 08:03:14 -04:00
MTLAttributeDescriptorTest.cs [tests] Update monotouch-test to add version checks when executing on older iOS versions. Fixes #43920 (#729) 2016-08-31 23:08:54 -04:00
MTLAttributeTest.cs [tests] Update monotouch-test to add version checks when executing on older iOS versions. Fixes #43920 (#729) 2016-08-31 23:08:54 -04:00
MTLBufferLayoutDescriptorTest.cs [tests] Update monotouch-test to add version checks when executing on older iOS versions. Fixes #43920 (#729) 2016-08-31 23:08:54 -04:00
MTLFunctionConstantTest.cs [tests] Update monotouch-test to add version checks when executing on older iOS versions. Fixes #43920 (#729) 2016-08-31 23:08:54 -04:00
MTLStageInputOutputDescriptorTest.cs [tests] Update monotouch-test to add version checks when executing on older iOS versions. Fixes #43920 (#729) 2016-08-31 23:08:54 -04:00