Skip to content

Commit

Permalink
LBPHFaceRecognizer setters and getters tests
Browse files Browse the repository at this point in the history
  • Loading branch information
diegohce authored and deadprogram committed Aug 14, 2024
1 parent 4388119 commit 66e0add
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion contrib/face_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package contrib

import (
"gocv.io/x/gocv"
"image"
"math"
"testing"

"gocv.io/x/gocv"
)

func TestLBPHFaceRecognizer_Methods(t *testing.T) {
Expand Down Expand Up @@ -90,3 +92,21 @@ func TestLBPHFaceRecognizer_Methods(t *testing.T) {
t.Errorf("Invalid loaded data: %d", label)
}
}

func TestLBPHFaceRecognizer_SetGridY_GetGridY(t *testing.T) {
facer := NewLBPHFaceRecognizer()
facer.SetGridY(5)

if v := facer.GetGridY(); v != 5 {
t.Errorf("got %d want 5", v)
}
}

func TestLBPHFaceRecognizer_SetGrid_GetGrid(t *testing.T) {
facer := NewLBPHFaceRecognizer()
facer.SetGrid(image.Point{7, 5})

if p := facer.GetGrid(); p.X != 7 || p.Y != 5 {
t.Errorf("got %+v want {7, 5}", p)
}
}

0 comments on commit 66e0add

Please sign in to comment.