From 19a4bc88e8025c3dd3ef8a622a7e6cf50bbcddbd Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Fri, 23 Aug 2024 23:02:21 +0200 Subject: [PATCH] test: exercise directory iterator beyond range-for --- test/compat_test.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/compat_test.cpp b/test/compat_test.cpp index 2a83face..8aecf7e9 100644 --- a/test/compat_test.cpp +++ b/test/compat_test.cpp @@ -1114,6 +1114,11 @@ void check_compat(logger& lgr, reader::filesystem_v2 const& fs, paths.emplace_back(dev.unix_path()); } EXPECT_EQ(expected, paths) << td; + paths.clear(); + for (auto it = dir->begin(); it != dir->end();) { + paths.emplace_back((it++)->unix_path()); + } + EXPECT_EQ(expected, paths) << td; } }