Minor tweaks/renamings

pull/28/head
Dustin Oprea 2020-01-01 02:45:37 -05:00
parent 78e9e28053
commit 22222b24d0
2 changed files with 19 additions and 19 deletions

View File

@ -7,7 +7,7 @@ import (
"github.com/dsoprea/go-logging"
)
func Test_IfdTagEntry_ValueString_Allocated(t *testing.T) {
func TestIfdTagEntry_ValueString_Allocated(t *testing.T) {
ite := IfdTagEntry{
TagId: 0x1,
TagIndex: 0,
@ -29,7 +29,7 @@ func Test_IfdTagEntry_ValueString_Allocated(t *testing.T) {
}
}
func Test_IfdTagEntry_ValueString_Embedded(t *testing.T) {
func TestIfdTagEntry_ValueString_Embedded(t *testing.T) {
data := []byte{0x11, 0x22, 0x33, 0x44}
ite := IfdTagEntry{
@ -51,7 +51,7 @@ func Test_IfdTagEntry_ValueString_Embedded(t *testing.T) {
}
}
func Test_IfdTagEntry_ValueString_Unknown(t *testing.T) {
func TestIfdTagEntry_ValueString_Unknown(t *testing.T) {
data := []uint8{'0', '2', '3', '0'}
ite := IfdTagEntry{
@ -73,7 +73,7 @@ func Test_IfdTagEntry_ValueString_Unknown(t *testing.T) {
}
}
func Test_IfdTagEntry_ValueBytes_Allocated(t *testing.T) {
func TestIfdTagEntry_ValueBytes_Allocated(t *testing.T) {
ite := IfdTagEntry{
TagId: 0x1,
TagIndex: 0,
@ -94,7 +94,7 @@ func Test_IfdTagEntry_ValueBytes_Allocated(t *testing.T) {
}
}
func Test_IfdTagEntry_ValueBytes_Embedded(t *testing.T) {
func TestIfdTagEntry_ValueBytes_Embedded(t *testing.T) {
data := []byte{0x11, 0x22, 0x33, 0x44}
ite := IfdTagEntry{
@ -115,7 +115,7 @@ func Test_IfdTagEntry_ValueBytes_Embedded(t *testing.T) {
}
}
func Test_IfdTagEntry_Value_Normal(t *testing.T) {
func TestIfdTagEntry_Value_Normal(t *testing.T) {
data := []byte{0x11, 0x22, 0x33, 0x44}
ite := IfdTagEntry{
@ -136,7 +136,7 @@ func Test_IfdTagEntry_Value_Normal(t *testing.T) {
}
}
func Test_IfdTagEntry_Value_Unknown(t *testing.T) {
func TestIfdTagEntry_Value_Unknown(t *testing.T) {
data := []uint8{'0', '2', '3', '0'}
ite := IfdTagEntry{
@ -162,7 +162,7 @@ func Test_IfdTagEntry_Value_Unknown(t *testing.T) {
}
}
func Test_IfdTagEntry_String(t *testing.T) {
func TestIfdTagEntry_String(t *testing.T) {
ite := IfdTagEntry{
TagId: 0x1,
TagIndex: 0,
@ -179,7 +179,7 @@ func Test_IfdTagEntry_String(t *testing.T) {
}
}
func Test_IfdTagEntryValueResolver_ValueBytes(t *testing.T) {
func TestIfdTagEntryValueResolver_ValueBytes(t *testing.T) {
allocatedData := []byte{0x11, 0x22, 0x33, 0x44, 0x55, 0x66}
ite := IfdTagEntry{

View File

@ -295,7 +295,7 @@ func (vc *ValueContext) ReadSignedRationals() (value []SignedRational, err error
// Since this method lacks the information to process unknown-type tags (e.g.
// byte-order, tag-ID, IFD type), it will return an error if attempted. See
// `Undefined()`.
func (vc *ValueContext) Values() (value interface{}, err error) {
func (vc *ValueContext) Values() (values interface{}, err error) {
defer func() {
if state := recover(); state != nil {
err = log.Wrap(state.(error))
@ -303,28 +303,28 @@ func (vc *ValueContext) Values() (value interface{}, err error) {
}()
if vc.tagType == TypeByte {
value, err = vc.ReadBytes()
values, err = vc.ReadBytes()
log.PanicIf(err)
} else if vc.tagType == TypeAscii {
value, err = vc.ReadAscii()
values, err = vc.ReadAscii()
log.PanicIf(err)
} else if vc.tagType == TypeAsciiNoNul {
value, err = vc.ReadAsciiNoNul()
values, err = vc.ReadAsciiNoNul()
log.PanicIf(err)
} else if vc.tagType == TypeShort {
value, err = vc.ReadShorts()
values, err = vc.ReadShorts()
log.PanicIf(err)
} else if vc.tagType == TypeLong {
value, err = vc.ReadLongs()
values, err = vc.ReadLongs()
log.PanicIf(err)
} else if vc.tagType == TypeRational {
value, err = vc.ReadRationals()
values, err = vc.ReadRationals()
log.PanicIf(err)
} else if vc.tagType == TypeSignedLong {
value, err = vc.ReadSignedLongs()
values, err = vc.ReadSignedLongs()
log.PanicIf(err)
} else if vc.tagType == TypeSignedRational {
value, err = vc.ReadSignedRationals()
values, err = vc.ReadSignedRationals()
log.PanicIf(err)
} else if vc.tagType == TypeUndefined {
log.Panicf("will not parse undefined-type value")
@ -338,7 +338,7 @@ func (vc *ValueContext) Values() (value interface{}, err error) {
return nil, nil
}
return value, nil
return values, nil
}
// Undefined attempts to identify and decode supported undefined-type fields.