From c49b1bc6d5adbe54c57d24d29a139c0ae02991f0 Mon Sep 17 00:00:00 2001 From: Andrey Pavlenko Date: Fri, 28 Dec 2012 17:03:35 +0400 Subject: [PATCH] partial fix for failing tests; fix for Windows launcher script; more quiet output --- .../src/org/opencv/test/core/TermCriteriaTest.java | 2 +- .../test/features2d/BRIEFDescriptorExtractorTest.java | 3 +-- .../test/features2d/BruteForceDescriptorMatcherTest.java | 3 +-- .../BruteForceHammingDescriptorMatcherTest.java | 2 +- .../BruteForceHammingLUTDescriptorMatcherTest.java | 2 +- .../features2d/BruteForceL1DescriptorMatcherTest.java | 2 +- .../features2d/BruteForceSL2DescriptorMatcherTest.java | 3 +-- .../opencv/test/features2d/FASTFeatureDetectorTest.java | 4 +--- .../test/features2d/FlannBasedDescriptorMatcherTest.java | 4 +--- .../test/features2d/ORBDescriptorExtractorTest.java | 3 +-- .../test/features2d/SIFTDescriptorExtractorTest.java | 3 +-- .../opencv/test/features2d/STARFeatureDetectorTest.java | 16 +--------------- .../test/features2d/SURFDescriptorExtractorTest.java | 3 +-- .../opencv/test/features2d/SURFFeatureDetectorTest.java | 5 +---- modules/java/java_test/CMakeLists.txt | 4 ++-- modules/java/java_test/build.xml | 14 +------------- 16 files changed, 17 insertions(+), 56 deletions(-) diff --git a/modules/java/android_test/src/org/opencv/test/core/TermCriteriaTest.java b/modules/java/android_test/src/org/opencv/test/core/TermCriteriaTest.java index 656d761..523a39d 100644 --- a/modules/java/android_test/src/org/opencv/test/core/TermCriteriaTest.java +++ b/modules/java/android_test/src/org/opencv/test/core/TermCriteriaTest.java @@ -77,7 +77,7 @@ public class TermCriteriaTest extends OpenCVTestCase { public void testToString() { String actual = tc2.toString(); - String expected = "{ type: 2, maxCount: 4, epsilon: 0.001}"; + String expected = "{ type: 2, maxCount: 4, epsilon: " + EPS + "}"; assertEquals(expected, actual); } diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BRIEFDescriptorExtractorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/BRIEFDescriptorExtractorTest.java index 9ac6cd4..4fdaa2d 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/BRIEFDescriptorExtractorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/BRIEFDescriptorExtractorTest.java @@ -26,10 +26,9 @@ public class BRIEFDescriptorExtractorTest extends OpenCVTestCase { @Override protected void setUp() throws Exception { + super.setUp(); extractor = DescriptorExtractor.create(DescriptorExtractor.BRIEF); matSize = 100; - - super.setUp(); } public void testComputeListOfMatListOfListOfKeyPointListOfMat() { diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceDescriptorMatcherTest.java b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceDescriptorMatcherTest.java index fcc389f..28e07b1 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceDescriptorMatcherTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceDescriptorMatcherTest.java @@ -80,6 +80,7 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase { } protected void setUp() throws Exception { + super.setUp(); matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE); matSize = 100; @@ -90,8 +91,6 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase { new DMatch(3, 1, 0, 0.48435235f), new DMatch(4, 0, 0, 1.0836693f) }; - - super.setUp(); } public void testAdd() { diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingDescriptorMatcherTest.java b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingDescriptorMatcherTest.java index cd32bca..08ff220 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingDescriptorMatcherTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingDescriptorMatcherTest.java @@ -65,6 +65,7 @@ public class BruteForceHammingDescriptorMatcherTest extends OpenCVTestCase { } protected void setUp() throws Exception { + super.setUp(); matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING); matSize = 100; @@ -73,7 +74,6 @@ public class BruteForceHammingDescriptorMatcherTest extends OpenCVTestCase { new DMatch(1, 2, 0, 42), new DMatch(2, 1, 0, 40), new DMatch(3, 3, 0, 53) }; - super.setUp(); } public void testAdd() { diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingLUTDescriptorMatcherTest.java b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingLUTDescriptorMatcherTest.java index 1c22a77..2d99c75 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingLUTDescriptorMatcherTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingLUTDescriptorMatcherTest.java @@ -65,6 +65,7 @@ public class BruteForceHammingLUTDescriptorMatcherTest extends OpenCVTestCase { } protected void setUp() throws Exception { + super.setUp(); matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMINGLUT); matSize = 100; @@ -73,7 +74,6 @@ public class BruteForceHammingLUTDescriptorMatcherTest extends OpenCVTestCase { new DMatch(1, 2, 0, 42), new DMatch(2, 1, 0, 40), new DMatch(3, 3, 0, 53) }; - super.setUp(); } public void testAdd() { diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceL1DescriptorMatcherTest.java b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceL1DescriptorMatcherTest.java index c15e937..d5370f3 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceL1DescriptorMatcherTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceL1DescriptorMatcherTest.java @@ -80,6 +80,7 @@ public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase { } protected void setUp() throws Exception { + super.setUp(); matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_L1); matSize = 100; @@ -90,7 +91,6 @@ public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase { new DMatch(3, 1, 0, 2.6545324f), new DMatch(4, 0, 0, 6.1294870f) }; - super.setUp(); } public void testAdd() { diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceSL2DescriptorMatcherTest.java b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceSL2DescriptorMatcherTest.java index 7c886c1..39253f0 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceSL2DescriptorMatcherTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceSL2DescriptorMatcherTest.java @@ -85,6 +85,7 @@ public class BruteForceSL2DescriptorMatcherTest extends OpenCVTestCase { } protected void setUp() throws Exception { + super.setUp(); matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_SL2); matSize = 100; @@ -95,8 +96,6 @@ public class BruteForceSL2DescriptorMatcherTest extends OpenCVTestCase { new DMatch(3, 1, 0, 0.23459719f), new DMatch(4, 0, 0, 1.174339f) }; - - super.setUp(); } public void testAdd() { diff --git a/modules/java/android_test/src/org/opencv/test/features2d/FASTFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/FASTFeatureDetectorTest.java index 35ffd64..8eeec37 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/FASTFeatureDetectorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/FASTFeatureDetectorTest.java @@ -33,12 +33,10 @@ public class FASTFeatureDetectorTest extends OpenCVTestCase { @Override protected void setUp() throws Exception { + super.setUp(); detector = FeatureDetector.create(FeatureDetector.FAST); - truth = new KeyPoint[] { new KeyPoint(32, 27, 7, -1, 254, 0, -1), new KeyPoint(27, 32, 7, -1, 254, 0, -1), new KeyPoint(73, 68, 7, -1, 254, 0, -1), new KeyPoint(68, 73, 7, -1, 254, 0, -1) }; - - super.setUp(); } public void testCreate() { diff --git a/modules/java/android_test/src/org/opencv/test/features2d/FlannBasedDescriptorMatcherTest.java b/modules/java/android_test/src/org/opencv/test/features2d/FlannBasedDescriptorMatcherTest.java index 6eb20ee..96e4986 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/FlannBasedDescriptorMatcherTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/FlannBasedDescriptorMatcherTest.java @@ -154,9 +154,9 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase { } protected void setUp() throws Exception { + super.setUp(); matcher = DescriptorMatcher.create(DescriptorMatcher.FLANNBASED); matSize = 100; - truth = new DMatch[] { new DMatch(0, 0, 0, 1.049694f), new DMatch(1, 0, 0, 1.0984558f), @@ -164,8 +164,6 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase { new DMatch(3, 1, 0, 0.48435235f), new DMatch(4, 0, 0, 1.0836693f) }; - - super.setUp(); } public void testAdd() { diff --git a/modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java index b30ec32..e9b65d1 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java @@ -31,10 +31,9 @@ public class ORBDescriptorExtractorTest extends OpenCVTestCase { @Override protected void setUp() throws Exception { + super.setUp(); extractor = DescriptorExtractor.create(DescriptorExtractor.ORB); matSize = 100; - - super.setUp(); } public void testComputeListOfMatListOfListOfKeyPointListOfMat() { diff --git a/modules/java/android_test/src/org/opencv/test/features2d/SIFTDescriptorExtractorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/SIFTDescriptorExtractorTest.java index 3302925..2fd83eb 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/SIFTDescriptorExtractorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/SIFTDescriptorExtractorTest.java @@ -28,6 +28,7 @@ public class SIFTDescriptorExtractorTest extends OpenCVTestCase { @Override protected void setUp() throws Exception { + super.setUp(); extractor = DescriptorExtractor.create(DescriptorExtractor.SIFT); keypoint = new KeyPoint(55.775577545166016f, 44.224422454833984f, 16, 9.754629f, 8617.863f, 1, -1); matSize = 100; @@ -44,8 +45,6 @@ public class SIFTDescriptorExtractorTest extends OpenCVTestCase { ); } }; - - super.setUp(); } public void testComputeListOfMatListOfListOfKeyPointListOfMat() { diff --git a/modules/java/android_test/src/org/opencv/test/features2d/STARFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/STARFeatureDetectorTest.java index 15e8fb9..0b7e4e1 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/STARFeatureDetectorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/STARFeatureDetectorTest.java @@ -42,22 +42,10 @@ public class STARFeatureDetectorTest extends OpenCVTestCase { } protected void setUp() throws Exception { + super.setUp(); detector = FeatureDetector.create(FeatureDetector.STAR); - matSize = 200; - truth = new KeyPoint[] { - /* - new KeyPoint(95, 80, 22, -1, 31.595734f, 0, -1), - new KeyPoint(105, 80, 22, -1, 31.595734f, 0, -1), - new KeyPoint(80, 95, 22, -1, 31.595734f, 0, -1), - new KeyPoint(120, 95, 22, -1, 31.595734f, 0, -1), - new KeyPoint(100, 100, 8, -1, -219.90825f, 0, -1), - new KeyPoint(80, 105, 22, -1, 31.595734f, 0, -1), - new KeyPoint(120, 105, 22, -1, 31.595734f, 0, -1), - new KeyPoint(95, 120, 22, -1, 31.595734f, 0, -1), - new KeyPoint(105, 120, 22, -1, 31.595734f, 0, -1) - */ new KeyPoint( 95, 80, 22, -1, 31.5957f, 0, -1), new KeyPoint(105, 80, 22, -1, 31.5957f, 0, -1), new KeyPoint( 80, 95, 22, -1, 31.5957f, 0, -1), @@ -68,8 +56,6 @@ public class STARFeatureDetectorTest extends OpenCVTestCase { new KeyPoint( 95, 120, 22, -1, 31.5957f, 0, -1), new KeyPoint(105, 120, 22, -1, 31.5957f, 0, -1) }; - - super.setUp(); } public void testCreate() { diff --git a/modules/java/android_test/src/org/opencv/test/features2d/SURFDescriptorExtractorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/SURFDescriptorExtractorTest.java index 56fcd28..8b063ee 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/SURFDescriptorExtractorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/SURFDescriptorExtractorTest.java @@ -26,10 +26,9 @@ public class SURFDescriptorExtractorTest extends OpenCVTestCase { @Override protected void setUp() throws Exception { + super.setUp(); extractor = DescriptorExtractor.create(DescriptorExtractor.SURF); matSize = 100; - - super.setUp(); } public void testComputeListOfMatListOfListOfKeyPointListOfMat() { diff --git a/modules/java/android_test/src/org/opencv/test/features2d/SURFFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/SURFFeatureDetectorTest.java index f44d08e..29da6ff 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/SURFFeatureDetectorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/SURFFeatureDetectorTest.java @@ -52,18 +52,15 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase { @Override protected void setUp() throws Exception { + super.setUp(); detector = FeatureDetector.create(FeatureDetector.SURF); - matSize = 100; - truth = new KeyPoint[] { new KeyPoint(55.775578f, 55.775578f, 16, 80.245735f, 8617.8633f, 0, -1), new KeyPoint(44.224422f, 55.775578f, 16, 170.24574f, 8617.8633f, 0, -1), new KeyPoint(44.224422f, 44.224422f, 16, 260.24573f, 8617.8633f, 0, -1), new KeyPoint(55.775578f, 44.224422f, 16, 350.24573f, 8617.8633f, 0, -1) }; - - super.setUp(); } public void testCreate() { diff --git a/modules/java/java_test/CMakeLists.txt b/modules/java/java_test/CMakeLists.txt index e912b0d..b2c8d10 100644 --- a/modules/java/java_test/CMakeLists.txt +++ b/modules/java/java_test/CMakeLists.txt @@ -70,8 +70,8 @@ file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/build.xml" DESTINATION "${opencv_test_jav # Create a script for running the Java tests and place it in build/bin. if(WIN32) - file(WRITE "${CMAKE_BINARY_DIR}/bin/opencv_test_java.cmd" "cd ${opencv_test_java_bin_dir}\nset path=${EXECUTABLE_OUTPUT_PATH};%path%\nant -DjavaLibraryPath=${EXECUTABLE_OUTPUT_PATH}/Release buildAndTest") - file(WRITE "${CMAKE_BINARY_DIR}/bin/opencv_test_java_D.cmd" "cd ${opencv_test_java_bin_dir}\nset path=${EXECUTABLE_OUTPUT_PATH};%path%\nant -DjavaLibraryPath=${EXECUTABLE_OUTPUT_PATH}/Debug buildAndTest") + file(WRITE "${CMAKE_BINARY_DIR}/bin/opencv_test_java.cmd" "cd ${opencv_test_java_bin_dir}\nset PATH=${EXECUTABLE_OUTPUT_PATH}/Release;%PATH%\nant -DjavaLibraryPath=${EXECUTABLE_OUTPUT_PATH}/Release buildAndTest") + file(WRITE "${CMAKE_BINARY_DIR}/bin/opencv_test_java_D.cmd" "cd ${opencv_test_java_bin_dir}\nset PATH=${EXECUTABLE_OUTPUT_PATH}/Debug;%PATH%\nant -DjavaLibraryPath=${EXECUTABLE_OUTPUT_PATH}/Debug buildAndTest") else() file(WRITE "${CMAKE_BINARY_DIR}/bin/opencv_test_java.sh" "cd ${opencv_test_java_bin_dir};\nant -DjavaLibraryPath=${LIBRARY_OUTPUT_PATH} buildAndTest;\ncd -") endif() diff --git a/modules/java/java_test/build.xml b/modules/java/java_test/build.xml index 29398b4..49d2bf1 100644 --- a/modules/java/java_test/build.xml +++ b/modules/java/java_test/build.xml @@ -31,21 +31,9 @@ - - - - - - - - - - - - - + -- 2.7.4