diff options
Diffstat (limited to 'core/fxcrt/bytestring_unittest.cpp')
-rw-r--r-- | core/fxcrt/bytestring_unittest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/fxcrt/bytestring_unittest.cpp b/core/fxcrt/bytestring_unittest.cpp index 2b7d4f7836..fb5fc0d996 100644 --- a/core/fxcrt/bytestring_unittest.cpp +++ b/core/fxcrt/bytestring_unittest.cpp @@ -5,6 +5,7 @@ #include "core/fxcrt/bytestring.h" #include <algorithm> +#include <iterator> #include <vector> #include "core/fxcrt/fx_string.h" @@ -1634,6 +1635,15 @@ TEST(ByteString, MultiCharIterator) { EXPECT_EQ('a' + 'b' + 'c', sum); } +TEST(ByteString, StdBegin) { + ByteString one_str("abc"); + std::vector<uint8_t> vec(std::begin(one_str), std::end(one_str)); + ASSERT_EQ(3u, vec.size()); + EXPECT_EQ('a', vec[0]); + EXPECT_EQ('b', vec[1]); + EXPECT_EQ('c', vec[2]); +} + TEST(ByteString, AnyAllNoneOf) { ByteString str("aaaaaaaaaaaaaaaaab"); EXPECT_FALSE(std::all_of(str.begin(), str.end(), |