mirror of
https://github.com/opencv/opencv.git
synced 2025-06-08 01:53:19 +08:00
revert changes in modules/core/src/persistence_yml.cpp (PR15842)
This commit is contained in:
commit
c4c4ac28dc
@ -1640,4 +1640,23 @@ TEST(Core_InputOutput, FileStorage_free_file_after_exception)
|
|||||||
ASSERT_EQ(0, std::remove(fileName.c_str()));
|
ASSERT_EQ(0, std::remove(fileName.c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(Core_InputOutput, FileStorage_YAML_parse_multiple_documents)
|
||||||
|
{
|
||||||
|
const std::string filename = "FileStorage_YAML_parse_multiple_documents.yml";
|
||||||
|
FileStorage fs;
|
||||||
|
|
||||||
|
fs.open(filename, FileStorage::WRITE);
|
||||||
|
fs << "a" << 42;
|
||||||
|
fs.release();
|
||||||
|
|
||||||
|
fs.open(filename, FileStorage::APPEND);
|
||||||
|
fs << "b" << 1988;
|
||||||
|
fs.release();
|
||||||
|
|
||||||
|
fs.open(filename, FileStorage::READ);
|
||||||
|
ASSERT_EQ(42, (int)fs["a"]);
|
||||||
|
ASSERT_EQ(1988, (int)fs["b"]);
|
||||||
|
fs.release();
|
||||||
|
}
|
||||||
|
|
||||||
}} // namespace
|
}} // namespace
|
||||||
|
Loading…
Reference in New Issue
Block a user