mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Merge branch 4.x
This commit is contained in:
@@ -1578,6 +1578,30 @@ TEST(Core_InputOutput, FileStorage_format_yml_gz)
|
||||
EXPECT_EQ(FileStorage::FORMAT_YAML, fs.getFormat());
|
||||
}
|
||||
|
||||
TEST(Core_InputOutput, FileStorage_json_null_object)
|
||||
{
|
||||
std::string test =
|
||||
"{ "
|
||||
"\"padding\": null,"
|
||||
"\"truncation\": null,"
|
||||
"\"version\": \"1.0\""
|
||||
"}";
|
||||
FileStorage fs(test, FileStorage::READ | FileStorage::MEMORY);
|
||||
|
||||
ASSERT_TRUE(fs["padding"].isNone());
|
||||
ASSERT_TRUE(fs["truncation"].isNone());
|
||||
ASSERT_TRUE(fs["version"].isString());
|
||||
|
||||
ASSERT_EQ(fs["padding"].name(), "padding");
|
||||
ASSERT_EQ(fs["truncation"].name(), "truncation");
|
||||
ASSERT_EQ(fs["version"].name(), "version");
|
||||
|
||||
ASSERT_EQ(fs["padding"].string(), "");
|
||||
ASSERT_EQ(fs["truncation"].string(), "");
|
||||
ASSERT_EQ(fs["version"].string(), "1.0");
|
||||
fs.release();
|
||||
}
|
||||
|
||||
TEST(Core_InputOutput, FileStorage_json_named_nodes)
|
||||
{
|
||||
std::string test =
|
||||
|
||||
Reference in New Issue
Block a user