Commit 39874ef7 authored by Maksim Shabunin's avatar Maksim Shabunin

Fixed some failing java tests

- fixed lena.png extension
- fixed getTextSize wrapper
- added junit html report generation
parent c42424f2
...@@ -448,9 +448,9 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1minMaxLocManual ...@@ -448,9 +448,9 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1minMaxLocManual
'cpp_code' : 'cpp_code' :
""" """
// C++: Size getTextSize(const String& text, int fontFace, double fontScale, int thickness, int* baseLine); // 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) (JNIEnv* env, jclass, jstring text, jint fontFace, jdouble fontScale, jint thickness, jintArray baseLine)
{ {
try { try {
...@@ -487,13 +487,13 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1minMaxLocManual ...@@ -487,13 +487,13 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1minMaxLocManual
return result; return result;
} catch(const cv::Exception& e) { } 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"); jclass je = env->FindClass("org/opencv/core/CvException");
if(!je) je = env->FindClass("java/lang/Exception"); if(!je) je = env->FindClass("java/lang/Exception");
env->ThrowNew(je, e.what()); env->ThrowNew(je, e.what());
return NULL; return NULL;
} catch (...) { } catch (...) {
LOGD("Core::n_1getTextSize() catched unknown exception (...)"); LOGD("Imgproc::n_1getTextSize() catched unknown exception (...)");
jclass je = env->FindClass("java/lang/Exception"); jclass je = env->FindClass("java/lang/Exception");
env->ThrowNew(je, "Unknown exception in JNI code {core::getTextSize()}"); env->ThrowNew(je, "Unknown exception in JNI code {core::getTextSize()}");
return NULL; return NULL;
......
<project> <project>
<property file="ant-${opencv.build.type}.properties"/> <property file="ant-${opencv.build.type}.properties"/>
<property name="test.dir" value="testResults"/>
<property name="build.dir" value="build"/>
<path id="master-classpath"> <path id="master-classpath">
<fileset dir="lib"> <fileset dir="lib">
...@@ -12,7 +14,7 @@ ...@@ -12,7 +14,7 @@
<target name="clean"> <target name="clean">
<delete dir="build"/> <delete dir="build"/>
<delete dir="testResults"/> <delete dir="${test.dir}"/>
</target> </target>
<target name="compile"> <target name="compile">
...@@ -34,7 +36,7 @@ ...@@ -34,7 +36,7 @@
</target> </target>
<target name="test"> <target name="test">
<mkdir dir="testResults"/> <mkdir dir="${test.dir}"/>
<junit printsummary="true" haltonfailure="false" haltonerror="false" showoutput="false" logfailedtests="true" maxmemory="256m"> <junit printsummary="true" haltonfailure="false" haltonerror="false" showoutput="false" logfailedtests="true" maxmemory="256m">
<sysproperty key="java.library.path" path="${opencv.lib.path}"/> <sysproperty key="java.library.path" path="${opencv.lib.path}"/>
<env key="PATH" path="${opencv.lib.path}"/> <env key="PATH" path="${opencv.lib.path}"/>
...@@ -45,12 +47,18 @@ ...@@ -45,12 +47,18 @@
<formatter type="xml"/> <formatter type="xml"/>
<batchtest fork="yes" todir="testResults"> <batchtest fork="yes" todir="${test.dir}">
<zipfileset src="build/jar/opencv-test.jar" includes="**/*.class" excludes="**/OpenCVTest*"> <zipfileset src="build/jar/opencv-test.jar" includes="**/*.class" excludes="**/OpenCVTest*">
<exclude name="**/*$*.class"/> <exclude name="**/*$*.class"/>
</zipfileset> </zipfileset>
</batchtest> </batchtest>
</junit> </junit>
<junitreport todir="${test.dir}">
<fileset dir="${test.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="noframes" todir="${test.dir}"/>
</junitreport>
</target> </target>
<target name="build"> <target name="build">
......
...@@ -116,7 +116,7 @@ public class OpenCVTestCase extends TestCase { ...@@ -116,7 +116,7 @@ public class OpenCVTestCase extends TestCase {
return; 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.CHESS_PATH = pwd + "res/drawable/chessboard.jpg";
OpenCVTestRunner.LBPCASCADE_FRONTALFACE_PATH = pwd + "res/raw/lbpcascade_frontalface.xml"; OpenCVTestRunner.LBPCASCADE_FRONTALFACE_PATH = pwd + "res/raw/lbpcascade_frontalface.xml";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment