Skip to content

Commit

Permalink
Merge pull request opencv#8671 from tomoaki0705:fixBuildVS2012sprintf
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Apr 29, 2017
2 parents 14ae679 + 0f5aaad commit 0457361
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions modules/core/test/test_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,11 @@ TEST(Core_InputOutput, FileStorage_DMatch)

EXPECT_NO_THROW(fs << "d" << d);
cv::String fs_result = fs.releaseAndGetString();
#if defined _MSC_VER && _MSC_VER <= 1700 /* MSVC 2012 and older */
EXPECT_STREQ(fs_result.c_str(), "%YAML:1.0\n---\nd: [ 1, 2, 3, -1.5000000000000000e+000 ]\n");
#else
EXPECT_STREQ(fs_result.c_str(), "%YAML:1.0\n---\nd: [ 1, 2, 3, -1.5000000000000000e+00 ]\n");
#endif

cv::FileStorage fs_read(fs_result, cv::FileStorage::READ | cv::FileStorage::MEMORY);

Expand All @@ -1138,12 +1142,21 @@ TEST(Core_InputOutput, FileStorage_DMatch_vector)

EXPECT_NO_THROW(fs << "dv" << dv);
cv::String fs_result = fs.releaseAndGetString();
#if defined _MSC_VER && _MSC_VER <= 1700 /* MSVC 2012 and older */
EXPECT_STREQ(fs_result.c_str(),
"%YAML:1.0\n"
"---\n"
"dv: [ 1, 2, 3, -1.5000000000000000e+000, 2, 3, 4,\n"
" 1.5000000000000000e+000, 3, 2, 1, 5.0000000000000000e-001 ]\n"
);
#else
EXPECT_STREQ(fs_result.c_str(),
"%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"
);
#endif

cv::FileStorage fs_read(fs_result, cv::FileStorage::READ | cv::FileStorage::MEMORY);

Expand Down Expand Up @@ -1182,6 +1195,17 @@ TEST(Core_InputOutput, FileStorage_DMatch_vector_vector)

EXPECT_NO_THROW(fs << "dvv" << dvv);
cv::String fs_result = fs.releaseAndGetString();
#if defined _MSC_VER && _MSC_VER <= 1700 /* MSVC 2012 and older */
EXPECT_STREQ(fs_result.c_str(),
"%YAML:1.0\n"
"---\n"
"dvv:\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"
);
#else
EXPECT_STREQ(fs_result.c_str(),
"%YAML:1.0\n"
"---\n"
Expand All @@ -1190,6 +1214,7 @@ TEST(Core_InputOutput, FileStorage_DMatch_vector_vector)
" 3, 2, 1, 5.0000000000000000e-01 ]\n"
" - [ 3, 2, 1, 5.0000000000000000e-01, 1, 2, 3, -1.5000000000000000e+00 ]\n"
);
#endif

cv::FileStorage fs_read(fs_result, cv::FileStorage::READ | cv::FileStorage::MEMORY);

Expand Down

0 comments on commit 0457361

Please sign in to comment.