Add help view and refine AR tank placement
This commit is contained in:
@ -10,10 +10,13 @@ import Testing
|
||||
|
||||
struct GasTankARTests {
|
||||
|
||||
@Test func example() async throws {
|
||||
// Write your test here and use APIs like `#expect(...)` to check expected conditions.
|
||||
// Swift Testing Documentation
|
||||
// https://developer.apple.com/documentation/testing
|
||||
@Test func tankResizingIsOffByDefaultAndReleaseCannotEnableIt() {
|
||||
#expect(TankResizePolicy.isEnabled(devFlag: false) == false)
|
||||
#if DEBUG
|
||||
#expect(TankResizePolicy.isEnabled(devFlag: true) == true)
|
||||
#else
|
||||
#expect(TankResizePolicy.isEnabled(devFlag: true) == false)
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -19,11 +19,11 @@ struct TankCatalogTests {
|
||||
"sizeDisplayNames": { "t1_2": "1,2 t", "t2_9": "2,9 t" },
|
||||
"colorDisplayNames": { "white": "Weiß", "green": "Hellgrün", "olive": "Olivgrün" },
|
||||
"tanks": [
|
||||
{ "size": "t1_2", "color": "white", "placement": "aboveGround", "modelPath": "DG-2700_wh.usdz" },
|
||||
{ "size": "t1_2", "color": "green", "placement": "aboveGround", "modelPath": "DG-2700_mi.usdz" },
|
||||
{ "size": "t1_2", "color": "olive", "placement": "belowGround", "modelPath": "DG-2700_ol.usdz" },
|
||||
{ "size": "t2_9", "color": "white", "placement": "aboveGround", "modelPath": "DG-6400_wh.usdz" },
|
||||
{ "size": "t2_9", "color": "olive", "placement": "belowGround", "modelPath": "DG-6400_ol.usdz" }
|
||||
{ "size": "t1_2", "color": "white", "placement": "aboveGround", "modelPath": "DG-2700_wh.usdz", "domeCenterX": -0.426 },
|
||||
{ "size": "t1_2", "color": "green", "placement": "aboveGround", "modelPath": "DG-2700_mi.usdz", "domeCenterX": -0.426 },
|
||||
{ "size": "t1_2", "color": "olive", "placement": "belowGround", "modelPath": "DG-2700_ol.usdz", "domeCenterX": -0.498 },
|
||||
{ "size": "t2_9", "color": "white", "placement": "aboveGround", "modelPath": "DG-6400_wh.usdz", "domeCenterX": -1.939 },
|
||||
{ "size": "t2_9", "color": "olive", "placement": "belowGround", "modelPath": "DG-6400_ol.usdz", "domeCenterX": -2.018 }
|
||||
]
|
||||
}
|
||||
"""
|
||||
@ -43,6 +43,7 @@ struct TankCatalogTests {
|
||||
#expect(def.color == .white)
|
||||
#expect(def.placement == .aboveGround)
|
||||
#expect(def.modelPath == "DG-2700_wh.usdz")
|
||||
#expect(def.domeCenterX == -0.426)
|
||||
#expect(def.modelResourceName == "DG-2700_wh")
|
||||
#expect(def.modelFileExtension == "usdz")
|
||||
}
|
||||
|
||||
@ -42,6 +42,29 @@ struct TankModelSelectionTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test func everyVariantHasItsMeasuredDomeCenter() {
|
||||
let expected: [String: Float] = [
|
||||
"DG-2700_wh.usdz": -0.426,
|
||||
"DG-2700_mi.usdz": -0.426,
|
||||
"DG-2700_ol.usdz": -0.498,
|
||||
"DG-4850_wh.usdz": -1.317,
|
||||
"DG-4850_mi.usdz": -1.317,
|
||||
"DG-4850_ol.usdz": -1.395,
|
||||
"DG-6400_wh.usdz": -1.939,
|
||||
"DG-6400_mi.usdz": -1.939,
|
||||
"DG-6400_ol.usdz": -2.018,
|
||||
]
|
||||
let definitions = Self.bundleCatalog().definitions
|
||||
#expect(definitions.count == expected.count)
|
||||
for definition in definitions {
|
||||
let measured = expected[definition.modelPath]
|
||||
#expect(measured != nil, "Kein Domschachtmaß für \(definition.modelPath)")
|
||||
if let measured {
|
||||
#expect(abs(definition.domeCenterX - measured) < 0.001)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Auswahl → richtige Datei
|
||||
|
||||
@Test func aboveGroundColorsMapToExpectedFiles() {
|
||||
|
||||
Reference in New Issue
Block a user