Slice 2 (Phase 1a) of the M9 Monterey retarget. Converts all pure Core suites (argv builders, CGATS/CUPS/profcheck/gamut-mesh parsers, colour math, file/artefact helpers, classifiers) to XCTestCase, and adds the shared assertAsyncThrows helper for the async-throws sites that Slice 3 will convert. Deferred to Slice 3 (kept on Swift Testing in mixed files): ProcessManagerTests, ArgyllRunner*Tests, ProcessRunSupportTests, store/UI suites, and the runner suites embedded in TargenTests / PrinttargTests / ProcessManagerTests. Also qualifies six bare `throw .case` expressions in CGATSParser with CGATSParseError — they only compiled under typed throws, which Slice 1 demoted to untyped `throws`; without this the ICCeryCore target fails to build and no test gate can run. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
32 lines
898 B
Swift
32 lines
898 B
Swift
import XCTest
|
|
import SceneKit
|
|
import ICCeryCore
|
|
@testable import ICCery
|
|
|
|
/// ``GamutSceneGeometryBuilder`` edge-case tests.
|
|
@MainActor
|
|
final class GamutGeometryBuilderTests: XCTestCase {
|
|
|
|
func testDropsOutOfBoundsFaces() {
|
|
let white = GamutVertex(
|
|
lab: LabColor(l: 100, a: 0, b: 0),
|
|
rgb: DisplayRGB(r: 1, g: 1, b: 1)
|
|
)
|
|
let black = GamutVertex(
|
|
lab: LabColor(l: 0, a: 0, b: 0),
|
|
rgb: DisplayRGB(r: 0, g: 0, b: 0)
|
|
)
|
|
let mesh = GamutMesh(
|
|
vertices: [white, black],
|
|
faces: [
|
|
GamutTriangle(a: 0, b: 1, c: 0),
|
|
GamutTriangle(a: 0, b: 1, c: 99)
|
|
]
|
|
)
|
|
|
|
let (_, element) = GamutSceneGeometryBuilder.geometry(for: mesh)
|
|
|
|
XCTAssertEqual(element.primitiveCount, 1, "Only the in-bounds face should be in the index buffer")
|
|
}
|
|
}
|