Skip to content

Commit

Permalink
Add (accidentally) removed defer desc.Close()
Browse files Browse the repository at this point in the history
  • Loading branch information
pericles-tpt committed Oct 20, 2023
1 parent 3e5f18b commit f763d2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contrib/xfeatures2d_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func TestSURF(t *testing.T) {
defer mask.Close()

kpc, desc := si.Compute(img, mask, kp)
defer desc.Close()
if len(kpc) < 512 {
t.Errorf("Invalid KeyPoint array in SURF Compute: %d", len(kpc))
}
Expand Down Expand Up @@ -78,6 +79,7 @@ func TestSURFWithParams(t *testing.T) {
defer mask.Close()

kpc, desc := si.Compute(img, mask, kp)
defer desc.Close()
if len(kpc) < 512 {
t.Errorf("Invalid KeyPoint array in SURF Compute: %d", len(kpc))
}
Expand Down
5 changes: 5 additions & 0 deletions features2d_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func TestAKAZE(t *testing.T) {
defer mask.Close()

kpc, desc := ak.Compute(img, mask, kp)
defer desc.Close()
if len(kpc) < 512 {
t.Errorf("Invalid KeyPoint array in AKAZE Compute: %d", len(kpc))
}
Expand Down Expand Up @@ -85,6 +86,7 @@ func TestBRISK(t *testing.T) {
defer mask.Close()

kpc, desc := br.Compute(img, mask, kp)
defer desc.Close()
if len(kpc) < 512 {
t.Errorf("Invalid KeyPoint array in BRISK Compute: %d", len(kpc))
}
Expand Down Expand Up @@ -181,6 +183,7 @@ func TestKAZE(t *testing.T) {
defer mask.Close()

kpc, desc := k.Compute(img, mask, kp)
defer desc.Close()
if len(kpc) < 512 {
t.Errorf("Invalid KeyPoint array in KAZE Compute: %d", len(kpc))
}
Expand Down Expand Up @@ -239,6 +242,7 @@ func TestORB(t *testing.T) {
defer mask.Close()

kpc, desc := od.Compute(img, mask, kp)
defer desc.Close()
if len(kpc) < 500 {
t.Errorf("Invalid KeyPoint array in ORB Compute: %d", len(kpc))
}
Expand Down Expand Up @@ -610,6 +614,7 @@ func TestSIFT(t *testing.T) {
defer mask.Close()

kpc, desc := si.Compute(img, mask, kp)
defer desc.Close()
if len(kpc) < 512 {
t.Errorf("Invalid KeyPoint array in SIFT Compute: %d", len(kpc))
}
Expand Down

0 comments on commit f763d2d

Please sign in to comment.