-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtransform_test.go
76 lines (68 loc) · 1.96 KB
/
transform_test.go
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
73
74
75
76
package ocio
import (
"testing"
)
func TestDisplayTransform(t *testing.T) {
dt := NewDisplayTransform()
// assert interface
var _ Transform = dt
if val := dt.Display(); val != "" {
t.Errorf("expected empty string; got %q", val)
}
if val := dt.View(); val != "" {
t.Errorf("expected empty string; got %q", val)
}
if val := dt.InputColorSpace(); val != "" {
t.Errorf("expected empty string; got %q", val)
}
if val := dt.LooksOverride(); val != "" {
t.Errorf("expected empty string; got %q", val)
}
if val := dt.LooksOverrideEnabled(); val {
t.Errorf("expected false; got %v", val)
}
if val := dt.Direction(); val != TRANSFORM_DIR_FORWARD {
t.Errorf("expected TRANSFORM_DIR_FORWARD(%v); got %v", TRANSFORM_DIR_FORWARD, val)
}
dt.SetDisplay("display")
dt.SetView("view")
dt.SetInputColorSpace("cs")
dt.SetLooksOverride("looks")
dt.SetLooksOverrideEnabled(true)
dt.SetDirection(TRANSFORM_DIR_INVERSE)
if val := dt.Display(); val != "display" {
t.Errorf("expected 'display'; got %q", val)
}
if val := dt.View(); val != "view" {
t.Errorf("expected 'view'; got %q", val)
}
if val := dt.InputColorSpace(); val != "cs" {
t.Errorf("expected 'cs'; got %q", val)
}
if val := dt.LooksOverride(); val != "looks" {
t.Errorf("expected 'looks'; got %q", val)
}
if val := dt.LooksOverrideEnabled(); !val {
t.Errorf("expected true; got %v", val)
}
if val := dt.Direction(); val != TRANSFORM_DIR_INVERSE {
t.Errorf("expected TRANSFORM_DIR_INVERSE(%v); got %v", TRANSFORM_DIR_INVERSE, val)
}
cpy := dt.EditableCopy()
cpy.SetDisplay("display2")
cpy.SetView("view2")
if val := cpy.Display(); val != "display2" {
t.Errorf("expected 'display2'; got %q", val)
}
if val := cpy.View(); val != "view2" {
t.Errorf("expected 'view2'; got %q", val)
}
if val := dt.Display(); val != "display" {
t.Errorf("expected 'display'; got %q", val)
}
if val := dt.View(); val != "view" {
t.Errorf("expected 'view'; got %q", val)
}
dt.Destroy()
cpy.Destroy()
}