Add Mat profile wrapper in other areas of the library.

This commit is contained in:
Douglas Dawson
2018-11-18 15:22:14 -05:00
parent 71a026458f
commit 94247f8604
7 changed files with 35 additions and 11 deletions

View File

@@ -15,6 +15,7 @@ import (
func TestIMRead(t *testing.T) {
img := IMRead("images/face-detect.jpg", IMReadColor)
defer img.Close()
if img.Empty() {
t.Error("Invalid Mat in IMRead")
}
@@ -25,6 +26,7 @@ func TestIMWrite(t *testing.T) {
tmpfn := filepath.Join(dir, "test.jpg")
img := IMRead("images/face-detect.jpg", IMReadColor)
defer img.Close()
if img.Empty() {
t.Error("Invalid read of Mat in IMWrite test")
}
@@ -40,6 +42,7 @@ func TestIMWriteWithParams(t *testing.T) {
tmpfn := filepath.Join(dir, "test.jpg")
img := IMRead("images/face-detect.jpg", IMReadColor)
defer img.Close()
if img.Empty() {
t.Error("Invalid read of Mat in IMWrite test")
}
@@ -52,6 +55,7 @@ func TestIMWriteWithParams(t *testing.T) {
func TestIMEncode(t *testing.T) {
img := IMRead("images/face-detect.jpg", IMReadColor)
defer img.Close()
if img.Empty() {
t.Error("Invalid Mat in IMEncode test")
}
@@ -94,6 +98,7 @@ func ExampleIMEncodeWithParams() {
func TestIMEncodeWithParams(t *testing.T) {
img := IMRead("images/face-detect.jpg", IMReadColor)
defer img.Close()
if img.Empty() {
t.Error("Invalid Mat in IMEncode test")
}
@@ -132,6 +137,7 @@ func TestIMDecode(t *testing.T) {
if dec.Empty() {
t.Error("Invalid Mat in IMDecode")
}
dec.Close()
dec, err = IMDecode([]byte{}, IMReadColor)
if err == nil {