1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge pull request #8159 from alalek:fix_8158

This commit is contained in:
Alexander Alekhin
2017-02-09 15:52:38 +00:00
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -748,7 +748,7 @@ const char* String::begin() const
inline
const char* String::end() const
{
return len_ ? cstr_ + 1 : 0;
return len_ ? cstr_ + len_ : NULL;
}
inline
+7
View File
@@ -138,3 +138,10 @@ TEST(Core_String, find_last_of__with__empty_string)
// npos is not exported: EXPECT_EQ(cv::String::npos, p);
EXPECT_EQ(std::string::npos, p);
}
TEST(Core_String, end_method_regression)
{
cv::String old_string = "012345";
cv::String new_string(old_string.begin(), old_string.end());
EXPECT_EQ(6u, new_string.size());
}