-
Notifications
You must be signed in to change notification settings - Fork 2
/
vtf_test.go
56 lines (47 loc) · 963 Bytes
/
vtf_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
package vtf
import (
"os"
"testing"
)
func TestVtf_Header(t *testing.T) {
f, err := os.Open("samples/read/test.vtf")
if err != nil {
t.Error(err)
}
defer f.Close()
vtf, err := ReadFromStream(f)
if err != nil {
t.Error(err)
}
if vtf.Header().Signature != [4]byte{86, 84, 70, 0} {
t.Error("format signature mismatch")
}
}
func TestVtf_HighResImageData(t *testing.T) {
f, err := os.Open("samples/read/test.vtf")
if err != nil {
t.Error(err)
}
defer f.Close()
vtf, err := ReadFromStream(f)
if err != nil {
t.Error(err)
}
if len(vtf.HighResImageData()) == 0 {
t.Error("expected high resolution data, received none")
}
}
func TestVtf_LowResImageData(t *testing.T) {
f, err := os.Open("samples/read/test.vtf")
if err != nil {
t.Error(err)
}
defer f.Close()
vtf, err := ReadFromStream(f)
if err != nil {
t.Error(err)
}
if len(vtf.LowResImageData()) == 0 {
t.Error("expected low resolution data, received none")
}
}