Exemplo n.º 1
0
        public void CreateIccData()
        {
            TestRuntime.AssertXcodeVersion(8, 0);

            using (var icc = NSData.FromFile(Path.Combine(NSBundle.MainBundle.ResourcePath, "LL-171A-B-B797E457-16AB-C708-1E0F-32C19DBD47B5.icc"))) {
                using (var cs = CGColorSpace.CreateIccData(icc)) {
                    TestICC(cs);
                }
                using (var provider = new CGDataProvider(icc)) {
                    using (var cs = CGColorSpace.CreateIccData(provider)) {
                        // broke? with Xcode 13 beta 1 (iOS, tvOS, watchOS)
                        if (TestRuntime.CheckXcodeVersion(13, 0))
                        {
                            Assert.Null(cs, "null colorspace");
                        }
                        else
                        {
                            TestICC(cs);
                        }
                    }
                }
            }

            using (var space = CGColorSpace.CreateIccData((NSData)null)) {
                Assert.IsNull(space, "null data");
            }

            using (var space = CGColorSpace.CreateIccData((CGDataProvider)null)) {
                Assert.IsNull(space, "null data provider");
            }
        }