Ask Your Question
1

Anyone having a test error on FileStorage_DMatch ?

asked 2017-04-22 04:27:52 -0600

tomoaki0705 gravatar image

summary

If you have VS2013, can you tell me the result of FileStorage_DMatch from opencv_test_core ?

Description

I'm using the master branch and realized that following three tests were failing

  • FileStorage_DMatch
  • FileStorage_DMatch_vector
  • FileStorage_DMatch_vector_vector

All of them comes from opencv_test_core

I'm using VS2012 on 64bit Win7. I digged in a while, and I came to a conclusion that this test failure is fixed behavior for VS2012. For example, in test FileStorage_DMatch, the expected result is hard coded as

"%YAML:1.0\n---\nd: [ 1, 2, 3, -1.5000000000000000e+00 ]\n"

when the actual result is

"%YAML:1.0\n---\nd: [ 1, 2, 3, -1.5000000000000000e+000 ]\n"

Please note that the number of the last 0s are the only difference. I traced a bit and I this comes from the result of sprintfof VS2012, and there is no other option to modify the result.

Question

I don't have other compiler than VS2012, but having a look to pullrequest.opencv.org, I believe this behavior is normal for VS2015 and modern GCC. I'm planning to create PR to fix this result, but before that, I'm not sure about the behavior of VS2013.

I guess the behavior of VS2010 and older will be same as VS2012. Also, the behavior of VS2017 and later will be same as VS2015. I have no idea what will happen for VS2013.

If anyone can try this situation on VS2013 (i.e. whether these tests from master will fail or not) I'm happy to hear the result.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
3

answered 2017-04-30 23:06:47 -0600

Eduardo gravatar image

This is what I got with Visual Studio 2013:

[ RUN      ] Core_InputOutput.FileStorage_DMatch
C:\opencv\modules\core\test\test_io.cpp(1117): error:       Expected: fs_result.c_str()
      Which is: "%YAML:1.0\n---\nd: [ 1, 2, 3, -1.5000000000000000e+000 ]\n"
To be equal to: "%YAML:1.0\n---\nd: [ 1, 2, 3, -1.5000000000000000e+00 ]\n"
With diff:
@@ -1,3 +1,3 @@
 %YAML:1.0
 ---
-d: [ 1, 2, 3, -1.5000000000000000e+000 ]\n
+d: [ 1, 2, 3, -1.5000000000000000e+00 ]\n

[  FAILED  ] Core_InputOutput.FileStorage_DMatch (1 ms)
[ RUN      ] Core_InputOutput.FileStorage_DMatch_vector
C:\opencv\modules\core\test\test_io.cpp(1158): error:       Expected: fs_result.c_str()
      Which is: "%YAML:1.0\n---\ndv: [ 1, 2, 3, -1.5000000000000000e+000, 2, 3, 4,\n    1.5000000000000000e+000, 3, 2, 1, 5.0000000000000000e-001 ]\n"
To be equal to: "%YAML:1.0\n" "---\n" "dv: [ 1, 2, 3, -1.5000000000000000e+00, 2, 3, 4, 1.5000000000000000e+00,\n" "    3, 2, 1, 5.0000000000000000e-01 ]\n"
      Which is: "%YAML:1.0\n---\ndv: [ 1, 2, 3, -1.5000000000000000e+00, 2, 3, 4, 1.5000000000000000e+00,\n    3, 2, 1, 5.0000000000000000e-01 ]\n"
With diff:
@@ -1,4 +1,4 @@
 %YAML:1.0
 ---
-dv: [ 1, 2, 3, -1.5000000000000000e+000, 2, 3, 4,
-    1.5000000000000000e+000, 3, 2, 1, 5.0000000000000000e-001 ]\n
+dv: [ 1, 2, 3, -1.5000000000000000e+00, 2, 3, 4, 1.5000000000000000e+00,
+    3, 2, 1, 5.0000000000000000e-01 ]\n

[  FAILED  ] Core_InputOutput.FileStorage_DMatch_vector (0 ms)
[ RUN      ] Core_InputOutput.FileStorage_DMatch_vector_vector
C:\opencv\modules\core\test\test_io.cpp(1216): error:       Expected: fs_result.c_str()
      Which is: "%YAML:1.0\n---\ndvv:\n   - [ 1, 2, 3, -1.5000000000000000e+000, 2, 3, 4,\n       1.5000000000000000e+000, 3, 2, 1, 5.0000000000000000e-001 ]\n   - [ 3, 2, 1, 5.0000000000000000e-001, 1, 2, 3,\n       -1.5000000000000000e+000 ]\n"
To be equal to: "%YAML:1.0\n" "---\n" "dvv:\n" "   - [ 1, 2, 3, -1.5000000000000000e+00, 2, 3, 4, 1.5000000000000000e+00,\n" "       3, 2, 1, 5.0000000000000000e-01 ]\n" "   - [ 3, 2, 1, 5.0000000000000000e-01, 1, 2, 3, -1.5000000000000000e+00 ]\n"
      Which is: "%YAML:1.0\n---\ndvv:\n   - [ 1, 2, 3, -1.5000000000000000e+00, 2, 3, 4, 1.5000000000000000e+00,\n       3, 2, 1, 5.0000000000000000e-01 ]\n   - [ 3, 2, 1, 5.0000000000000000e-01, 1, 2, 3, -1.5000000000000000e+00 ]\n"
With diff:
@@ -2,6 +2,5 @@
 ---
 dvv:
-   - [ 1, 2, 3, -1.5000000000000000e+000, 2, 3, 4,
-       1.5000000000000000e+000, 3, 2, 1, 5.0000000000000000e-001 ]
-   - [ 3, 2, 1, 5.0000000000000000e-001, 1, 2, 3,
-       -1.5000000000000000e+000 ]\n
+   - [ 1, 2, 3, -1.5000000000000000e+00, 2, 3, 4, 1.5000000000000000e+00,
+       3, 2, 1, 5.0000000000000000e-01 ]
+   - [ 3, 2, 1, 5.0000000000000000e-01, 1, 2, 3, -1.5000000000000000e+00 ]\n

[  FAILED  ] Core_InputOutput.FileStorage_DMatch_vector_vector (1 ms)

Looks like it is only since Visual Studio 2015 the exponent is printed correctly:

edit flag offensive delete link more
1

answered 2018-03-28 10:35:09 -0600

tomoaki0705 gravatar image

Oh, really sorry I missed your answer. I forgot to reply.

Really, thank you for your reply. The fix is now merged in to OpenCV.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-04-22 04:27:52 -0600

Seen: 516 times

Last updated: Mar 28 '18