java: test: use assertNotNull and assertFalse
This commit is contained in:
@@ -581,7 +581,7 @@ public class OpenCVTestCase extends TestCase {
|
||||
message = TAG + " :: " + "could not instantiate " + cname + "! Exception: " + ex.getMessage();
|
||||
}
|
||||
|
||||
assertTrue(message, instance!=null);
|
||||
assertNotNull(message, instance);
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public class OpenCVTestRunner extends InstrumentationTestRunner {
|
||||
}
|
||||
|
||||
context = getContext();
|
||||
Assert.assertTrue("Context can't be 'null'", context != null);
|
||||
Assert.assertNotNull("Context can't be 'null'", context);
|
||||
LENA_PATH = Utils.exportResource(context, R.drawable.lena);
|
||||
CHESS_PATH = Utils.exportResource(context, R.drawable.chessboard);
|
||||
LBPCASCADE_FRONTALFACE_PATH = Utils.exportResource(context, R.raw.lbpcascade_frontalface);
|
||||
|
||||
@@ -74,7 +74,7 @@ public class UtilsTest extends OpenCVTestCase {
|
||||
// RGBA
|
||||
Mat imgRGBA = new Mat();
|
||||
Imgproc.cvtColor(imgBGR, imgRGBA, Imgproc.COLOR_BGR2RGBA);
|
||||
assertTrue(!imgRGBA.empty() && imgRGBA.channels() == 4);
|
||||
assertFalse(imgRGBA.empty() && imgRGBA.channels() == 4);
|
||||
|
||||
bmp16.eraseColor(Color.BLACK); m16.setTo(s0);
|
||||
Utils.matToBitmap(imgRGBA, bmp16); Utils.bitmapToMat(bmp16, m16);
|
||||
@@ -92,7 +92,7 @@ public class UtilsTest extends OpenCVTestCase {
|
||||
// RGB
|
||||
Mat imgRGB = new Mat();
|
||||
Imgproc.cvtColor(imgBGR, imgRGB, Imgproc.COLOR_BGR2RGB);
|
||||
assertTrue(!imgRGB.empty() && imgRGB.channels() == 3);
|
||||
assertFalse(imgRGB.empty() && imgRGB.channels() == 3);
|
||||
|
||||
bmp16.eraseColor(Color.BLACK); m16.setTo(s0);
|
||||
Utils.matToBitmap(imgRGB, bmp16); Utils.bitmapToMat(bmp16, m16);
|
||||
@@ -110,7 +110,7 @@ public class UtilsTest extends OpenCVTestCase {
|
||||
// Gray
|
||||
Mat imgGray = new Mat();
|
||||
Imgproc.cvtColor(imgBGR, imgGray, Imgproc.COLOR_BGR2GRAY);
|
||||
assertTrue(!imgGray.empty() && imgGray.channels() == 1);
|
||||
assertFalse(imgGray.empty() && imgGray.channels() == 1);
|
||||
Mat tmp = new Mat();
|
||||
|
||||
bmp16.eraseColor(Color.BLACK); m16.setTo(s0);
|
||||
|
||||
Reference in New Issue
Block a user