forked from gillesdemey/go-dicom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparser_test.go
47 lines (34 loc) · 821 Bytes
/
parser_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
package dicom
import (
"bytes"
"testing"
)
func TestConstructor(t *testing.T) {
p, err := NewParser()
if err != nil {
t.Error(err)
}
if len(p.dictionary) == 0 {
t.Error("Error constructing parser. Dictionary can not be of 0 length")
}
}
func TestDictionaryOption(t *testing.T) {
dict := bytes.NewReader([]byte(dicomDictData))
p, err := NewParser(Dictionary(dict))
if err != nil {
t.Error(err)
}
if len(p.dictionary) == 0 {
t.Error("Error constructing parser. Dictionary can not be of 0 length")
}
}
func TestGetTag(t *testing.T) {
elem := &DicomElement{0x7FE0, 0x0010, "PixelData", "ox", 1, nil}
if tag := elem.getTag(); tag != "(7FE0,0010)" {
t.Errorf("Error creating tag. Incorrect value %s", tag)
}
}
func TestReadTag(t *testing.T) {
}
func TestReadDataElement(t *testing.T) {
}