diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-08-23 16:44:28 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-08-26 01:04:27 +0300 |
commit | a7d3570e7c2b33d2d9de2696909524b4bc35fc65 (patch) | |
tree | cd80898df0df302a3e2758b8cc7e6c7ff5b37562 /test | |
parent | a17f0eddc61486989a375e34dcdcbb15c3152a4a (diff) |
utils: Satisfy LegacyInputIterator with StringSplitter::iterator
The StringSplitter::iterator is used with the utils::split() function to
iterate over components of a split string. Add the necessary member
types expected by std::iterator_trait in order to satisfy the
LegacyInputIterator requirement and make the iterator usable in
constructors for various containers.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/utils.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/utils.cpp b/test/utils.cpp index 129807a6..58b5a59d 100644 --- a/test/utils.cpp +++ b/test/utils.cpp @@ -276,6 +276,14 @@ protected: return TestFail; } + const auto &split = utils::split(path, ":"); + dirs = std::vector<std::string>{ split.begin(), split.end() }; + + if (dirs != elements) { + cerr << "utils::split() LegacyInputIterator test failed" << endl; + return TestFail; + } + /* utils::join() with conversion function test. */ std::vector<Size> sizes = { { 0, 0 }, { 100, 100 } }; s = utils::join(sizes, "/", [](const Size &size) { |