while here, remove the unnecessary use of reflect.DeepEqual

This commit is contained in:
Zeke Lu 2022-09-27 04:35:04 +08:00
parent ca722a0580
commit 797c16480b
1 changed files with 7 additions and 7 deletions

View File

@ -231,7 +231,7 @@ func TestOpen(t *testing.T) {
continue continue
} }
defer f.Close() defer f.Close()
if !reflect.DeepEqual(f.FileHeader, tt.hdr) { if f.FileHeader != tt.hdr {
t.Errorf("open %s:\n\thave %#v\n\twant %#v\n", tt.file, f.FileHeader, tt.hdr) t.Errorf("open %s:\n\thave %#v\n\twant %#v\n", tt.file, f.FileHeader, tt.hdr)
continue continue
} }
@ -239,18 +239,18 @@ func TestOpen(t *testing.T) {
if i >= len(tt.sections) { if i >= len(tt.sections) {
break break
} }
sh := &tt.sections[i] sh := tt.sections[i]
if !reflect.DeepEqual(&s.SectionHeader, sh) { if s.SectionHeader != sh {
t.Errorf("open %s, section %d:\n\thave %#v\n\twant %#v\n", tt.file, i, &s.SectionHeader, sh) t.Errorf("open %s, section %d:\n\thave %#v\n\twant %#v\n", tt.file, i, s.SectionHeader, sh)
} }
} }
for i, p := range f.Progs { for i, p := range f.Progs {
if i >= len(tt.progs) { if i >= len(tt.progs) {
break break
} }
ph := &tt.progs[i] ph := tt.progs[i]
if !reflect.DeepEqual(&p.ProgHeader, ph) { if p.ProgHeader != ph {
t.Errorf("open %s, program %d:\n\thave %#v\n\twant %#v\n", tt.file, i, &p.ProgHeader, ph) t.Errorf("open %s, program %d:\n\thave %#v\n\twant %#v\n", tt.file, i, p.ProgHeader, ph)
} }
} }
tn := len(tt.sections) tn := len(tt.sections)