// RUN: %target-run-simple-swift // REQUIRES: executable_test // UNSUPPORTED: OS=watchos // REQUIRES: objc_interop import StdlibUnittest import Foundation import ModelIO var ModelIOTests = TestSuite("ModelIO") if #available(OSX 10.13, iOS 11.0, tvOS 11.0, *) { ModelIOTests.test("MDLAnimatedScalar/accessors") { let animatedVal = MDLAnimatedScalar() let testCount = 10 let testTimeVal = 5.0 let testFloatVal:Float = 1.0 let testDoubleVal = Double(testFloatVal) let fArray = [Float](repeating: testFloatVal, count: testCount) let dArray = [Double](repeating: testDoubleVal, count: testCount) var times = [TimeInterval](repeating: testTimeVal, count: testCount) animatedVal.reset(floatArray: fArray, atTimes: times) let floats = animatedVal.floatArray animatedVal.reset(doubleArray: dArray, atTimes: times) let doubles = animatedVal.doubleArray times = animatedVal.times expectEqual(floats.count, testCount) expectEqual(doubles.count, testCount) expectEqual(times.count, testCount) for idx in 0..