Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/pathmatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ class CPPCHECKLIB PathMatch {
return pattern;
}

private:
friend class TestPathMatch;
protected:
class PathIterator;

private:
/* List of patterns */
std::vector<std::string> mPatterns;
/* Base path to with patterns and paths are relative */
Expand Down
7 changes: 6 additions & 1 deletion test/testpathmatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ class TestPathMatch : public TestFixture {
TestPathMatch() : TestFixture("TestPathMatch") {}

private:
class PathMatchTest final : public PathMatch
{
friend class TestPathMatch;
};

static constexpr auto unix = PathMatch::Syntax::unix;
static constexpr auto windows = PathMatch::Syntax::windows;
static constexpr auto ifreg = PathMatch::Filemode::regular;
Expand Down Expand Up @@ -277,7 +282,7 @@ class TestPathMatch : public TestFixture {
void pathiterator() const {
/* See https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats
* for information on Windows path syntax. */
using PathIterator = PathMatch::PathIterator;
using PathIterator = PathMatchTest::PathIterator;
ASSERT_EQUALS("/", PathIterator("/", nullptr, unix).read());
ASSERT_EQUALS("/", PathIterator("//", nullptr, unix).read());
ASSERT_EQUALS("/", PathIterator("/", "/", unix).read());
Expand Down
Loading