Commit ec8aec09 authored by Andrey Kamaev's avatar Andrey Kamaev Committed by OpenCV Buildbot

Merge pull request #691 from vpisarev:fix_2899

parents 2c9f6512 a4815cf3
...@@ -2917,6 +2917,9 @@ CV_EXPORTS FileStorage& operator << (FileStorage& fs, const string& str); ...@@ -2917,6 +2917,9 @@ CV_EXPORTS FileStorage& operator << (FileStorage& fs, const string& str);
static inline FileStorage& operator << (FileStorage& fs, const char* str) static inline FileStorage& operator << (FileStorage& fs, const char* str)
{ return (fs << string(str)); } { return (fs << string(str)); }
static inline FileStorage& operator << (FileStorage& fs, char* value)
{ return (fs << string(value)); }
inline FileNode::FileNode() : fs(0), node(0) {} inline FileNode::FileNode() : fs(0), node(0) {}
inline FileNode::FileNode(const CvFileStorage* _fs, const CvFileNode* _node) inline FileNode::FileNode(const CvFileStorage* _fs, const CvFileNode* _node)
: fs(_fs), node(_node) {} : fs(_fs), node(_node) {}
......
...@@ -454,3 +454,12 @@ protected: ...@@ -454,3 +454,12 @@ protected:
TEST(Core_InputOutput, huge) { CV_BigMatrixIOTest test; test.safe_run(); } TEST(Core_InputOutput, huge) { CV_BigMatrixIOTest test; test.safe_run(); }
*/ */
TEST(Core_InputOutput, FileStorage)
{
std::string file = cv::tempfile(".xml");
cv::FileStorage f(file, cv::FileStorage::WRITE);
char arr[66];
sprintf(arr, "sprintf is hell %d", 666);
EXPECT_NO_THROW(f << arr);
}
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