From 39874ef742f213bf114543bc5d1e55bd7fe6c292 Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Thu, 11 Sep 2014 11:56:05 +0400 Subject: [PATCH] Fixed some failing java tests - fixed lena.png extension - fixed getTextSize wrapper - added junit html report generation --- modules/java/generator/gen_java.py | 8 ++++---- modules/java/test/build.xml | 14 +++++++++++--- modules/java/test/src/org/opencv/test/OpenCVTestCase.java | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/modules/java/generator/gen_java.py b/modules/java/generator/gen_java.py index 2b66f95..2c8e1b2 100755 --- a/modules/java/generator/gen_java.py +++ b/modules/java/generator/gen_java.py @@ -448,9 +448,9 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1minMaxLocManual 'cpp_code' : """ // C++: Size getTextSize(const String& text, int fontFace, double fontScale, int thickness, int* baseLine); - JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1getTextSize (JNIEnv*, jclass, jstring, jint, jdouble, jint, jintArray); + JNIEXPORT jdoubleArray JNICALL Java_org_opencv_imgproc_Imgproc_n_1getTextSize (JNIEnv*, jclass, jstring, jint, jdouble, jint, jintArray); - JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1getTextSize + JNIEXPORT jdoubleArray JNICALL Java_org_opencv_imgproc_Imgproc_n_1getTextSize (JNIEnv* env, jclass, jstring text, jint fontFace, jdouble fontScale, jint thickness, jintArray baseLine) { try { @@ -487,13 +487,13 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1minMaxLocManual return result; } catch(const cv::Exception& e) { - LOGD("Core::n_1getTextSize() catched cv::Exception: %s", e.what()); + LOGD("Imgproc::n_1getTextSize() catched cv::Exception: %s", e.what()); jclass je = env->FindClass("org/opencv/core/CvException"); if(!je) je = env->FindClass("java/lang/Exception"); env->ThrowNew(je, e.what()); return NULL; } catch (...) { - LOGD("Core::n_1getTextSize() catched unknown exception (...)"); + LOGD("Imgproc::n_1getTextSize() catched unknown exception (...)"); jclass je = env->FindClass("java/lang/Exception"); env->ThrowNew(je, "Unknown exception in JNI code {core::getTextSize()}"); return NULL; diff --git a/modules/java/test/build.xml b/modules/java/test/build.xml index d3f826c..4b25a3c 100644 --- a/modules/java/test/build.xml +++ b/modules/java/test/build.xml @@ -1,5 +1,7 @@ + + @@ -12,7 +14,7 @@ - + @@ -34,7 +36,7 @@ - + @@ -45,12 +47,18 @@ - + + + + + + + diff --git a/modules/java/test/src/org/opencv/test/OpenCVTestCase.java b/modules/java/test/src/org/opencv/test/OpenCVTestCase.java index 864c17e..e7d1506 100644 --- a/modules/java/test/src/org/opencv/test/OpenCVTestCase.java +++ b/modules/java/test/src/org/opencv/test/OpenCVTestCase.java @@ -116,7 +116,7 @@ public class OpenCVTestCase extends TestCase { return; } - OpenCVTestRunner.LENA_PATH = pwd + "res/drawable/lena.jpg"; + OpenCVTestRunner.LENA_PATH = pwd + "res/drawable/lena.png"; OpenCVTestRunner.CHESS_PATH = pwd + "res/drawable/chessboard.jpg"; OpenCVTestRunner.LBPCASCADE_FRONTALFACE_PATH = pwd + "res/raw/lbpcascade_frontalface.xml"; -- 2.7.4