1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Merge branch 4.x

This commit is contained in:
Alexander Smorkalov
2025-07-28 10:04:17 +03:00
28 changed files with 780 additions and 158 deletions
+1 -3
View File
@@ -623,9 +623,7 @@ public:
}
if( len == 4 && memcmp( beg, "null", 4 ) == 0 )
{
CV_PARSE_ERROR_CPP( "Value 'null' is not supported by this parser" );
}
;
else if( (len == 4 && memcmp( beg, "true", 4 ) == 0) ||
(len == 5 && memcmp( beg, "false", 5 ) == 0) )
{
+24
View File
@@ -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 =