Commit 04573615 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #8671 from tomoaki0705:fixBuildVS2012sprintf

parents 14ae6799 0f5aaade
......@@ -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);
......@@ -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);
......@@ -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"
......@@ -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);
......
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