Closed dwchoo closed 3 months ago
The cuda/arithm_test.go file was missing test code for two functions, so we added them.
cuda/arithm_test.go
MultiplyWithStream
TestMultiply
DivideWithStream
TestDivide
Invalid arguments in the NewTemplateMatching function and an error in the TestTemplateMatching_Match code in cuda/imgproc.go
NewTemplateMatching
TestTemplateMatching_Match
cuda/imgproc.go
// Original code func NewTemplateMatching(srcType int, method gocv.TemplateMatchMode) TemplateMatching { return TemplateMatching{p: unsafe.Pointer(C.TemplateMatching_Create(C.int(srcType), C.int(method)))} }
We change srcType int -> srcType gocv.MatType
srcType int
srcType gocv.MatType
// Edit code func NewTemplateMatching(srcType gocv.MatType, method gocv.TemplateMatchMode) TemplateMatching { return TemplateMatching{p: unsafe.Pointer(C.TemplateMatching_Create(C.int(srcType), C.int(method)))} }
We believe that the TestMatchTemplateMatching_Match Test code is designed incorrectly, and we have modified it by referring to the TestMatchTemplate in the imgproc_test.go file. The error in the test code is now gone, and you shouldn't see FAIL.
TestMatchTemplateMatching_Match
TestMatchTemplate
imgproc_test.go
This picture shows fail as a test result before modification.
This picture is the code that shows the test code result pass after modification.
Thank you very much for this fix @dwchoo now merging.
Add TestDivideWithStream and TestMultiplyWithStream
The
cuda/arithm_test.go
file was missing test code for two functions, so we added them.MultiplyWithStream
has not test code, butTestMultiply
is exist.DivideWithStream
has no test code, butTestDivide
is exist.Fix NewTemplateMatching and TestTemplateMatching_Match
Invalid arguments in the
NewTemplateMatching
function and an error in theTestTemplateMatching_Match
code incuda/imgproc.go
NewTemplateMatching
We change
srcType int
->srcType gocv.MatType
TestTemplateMatching_Match
We believe that the
TestMatchTemplateMatching_Match
Test code is designed incorrectly, and we have modified it by referring to theTestMatchTemplate
in theimgproc_test.go
file. The error in the test code is now gone, and you shouldn't see FAIL.