-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLayerTests.swift
More file actions
73 lines (58 loc) · 2.04 KB
/
LayerTests.swift
File metadata and controls
73 lines (58 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//
// LayerTests.swift
// OpenRenderBoxCompatibilityTests
import Testing
#if canImport(Darwin)
import QuartzCore
@MainActor
@Suite(.enabled(if: compatibilityTestEnabled))
struct LayerTests {
@Test
func testLayerProperties() {
let layer = ORBLayer()
// device
layer.device = ORBDevice.sharedDefault()
#expect(layer.device != nil)
// rendersAsynchronously
layer.rendersAsynchronously = true
#expect(layer.rendersAsynchronously == true)
layer.rendersAsynchronously = false
#expect(layer.rendersAsynchronously == false)
// colorMode
layer.colorMode = .init(0)
#expect(layer.colorMode.rawValue == 0)
layer.colorMode = .init(1)
#expect(layer.colorMode.rawValue == 1)
// promotesFramebuffer
layer.promotesFramebuffer = true
#expect(layer.promotesFramebuffer == true)
layer.promotesFramebuffer = false
#expect(layer.promotesFramebuffer == false)
// clearsBackground
layer.clearsBackground = true
#expect(layer.clearsBackground == true)
layer.clearsBackground = false
#expect(layer.clearsBackground == false)
// maxDrawableCount
layer.maxDrawableCount = 3
#expect(layer.maxDrawableCount == 3)
// allowsPackedDrawable
layer.allowsPackedDrawable = true
#expect(layer.allowsPackedDrawable == true)
layer.allowsPackedDrawable = false
#expect(layer.allowsPackedDrawable == false)
// allowsBottomLeftOrigin
layer.allowsBottomLeftOrigin = true
#expect(layer.allowsBottomLeftOrigin == true)
layer.allowsBottomLeftOrigin = false
#expect(layer.allowsBottomLeftOrigin == false)
// needsSynchronousUpdate
layer.needsSynchronousUpdate = true
#expect(layer.needsSynchronousUpdate == true)
layer.needsSynchronousUpdate = false
#expect(layer.needsSynchronousUpdate == false)
_ = layer.isDrawableAvailable
_ = layer.statistics
}
}
#endif