fix some functions for valid processing of empty string content (cstr_==0, len_==0)

This commit is contained in:
Alexander Alekhin
2015-08-10 14:35:42 +03:00
parent aed9f5d5e8
commit cda9ed449f
2 changed files with 12 additions and 0 deletions

View File

@@ -129,3 +129,12 @@ TEST(Core_OutputArrayAssign, _Matxf_UMatd)
EXPECT_LE(maxAbsDiff(expected, actual), FLT_EPSILON);
}
TEST(Core_String, find_last_of__with__empty_string)
{
cv::String s;
size_t p = s.find_last_of("q", 0);
// npos is not exported: EXPECT_EQ(cv::String::npos, p);
EXPECT_EQ(std::string::npos, p);
}