@@ -42,9 +42,9 @@ struct DebugInfoMatcher {
42
42
static constexpr const char * any_file = " *" ;
43
43
static constexpr const char * any_msg = " *" ;
44
44
45
- constexpr DebugInfoMatcher () : is_empty (true ), msg (any_msg, __builtin_strlen(any_msg)), file (any_file, __builtin_strlen(any_file)), line (any_line) { }
46
- constexpr DebugInfoMatcher (const char * msg_ , const char * file_ = any_file, int line_ = any_line)
47
- : is_empty (false ), msg( msg_, __builtin_strlen(msg_ )), file( file_, __builtin_strlen(file_ )), line( line_) {}
45
+ constexpr DebugInfoMatcher () : is_empty_ (true ), msg_ (any_msg, __builtin_strlen(any_msg)), file_ (any_file, __builtin_strlen(any_file)), line_ (any_line) { }
46
+ constexpr DebugInfoMatcher (const char * msg , const char * file = any_file, int line = any_line)
47
+ : is_empty_ (false ), msg_(msg , __builtin_strlen(msg )), file_(file , __builtin_strlen(file )), line_(line ) {}
48
48
49
49
bool Matches (std::__libcpp_debug_info const & got) const {
50
50
assert (!empty () && " empty matcher" );
@@ -59,25 +59,25 @@ struct DebugInfoMatcher {
59
59
}
60
60
61
61
std::string ToString () const {
62
- std::string result = " msg = \" " ; result += msg ; result += " \"\n " ;
63
- result += " line = " + (line == any_line ? " '*'" : std::to_string (line )) + " \n " ;
64
- result += " file = " + (file == any_file ? " '*'" : std::string (any_file ));
62
+ std::string result = " msg = \" " ; result += msg_ ; result += " \"\n " ;
63
+ result += " line = " + (line_ == any_line ? " '*'" : std::to_string (line_ )) + " \n " ;
64
+ result += " file = " + (file_ == any_file ? " '*'" : std::string (file_ ));
65
65
return result;
66
66
}
67
67
68
- bool empty () const { return is_empty ; }
68
+ bool empty () const { return is_empty_ ; }
69
69
private:
70
70
bool CheckLineMatches (int got_line) const {
71
- if (line == any_line)
71
+ if (line_ == any_line)
72
72
return true ;
73
- return got_line == line ;
73
+ return got_line == line_ ;
74
74
}
75
75
76
76
bool CheckFileMatches (std::string_view got_file) const {
77
77
assert (!empty () && " empty matcher" );
78
- if (file == any_file)
78
+ if (file_ == any_file)
79
79
return true ;
80
- std::size_t found_at = got_file.find (file );
80
+ std::size_t found_at = got_file.find (file_ );
81
81
if (found_at == std::string_view::npos)
82
82
return false ;
83
83
// require the match start at the beginning of the file or immediately after
@@ -88,24 +88,24 @@ struct DebugInfoMatcher {
88
88
return false ;
89
89
}
90
90
// require the match goes until the end of the string.
91
- return got_file.substr (found_at) == file ;
91
+ return got_file.substr (found_at) == file_ ;
92
92
}
93
93
94
94
bool CheckMessageMatches (std::string_view got_msg) const {
95
95
assert (!empty () && " empty matcher" );
96
- if (msg == any_msg)
96
+ if (msg_ == any_msg)
97
97
return true ;
98
- std::size_t found_at = got_msg.find (msg );
98
+ std::size_t found_at = got_msg.find (msg_ );
99
99
if (found_at == std::string_view::npos)
100
100
return false ;
101
101
// Allow any match
102
102
return true ;
103
103
}
104
104
private:
105
- bool is_empty ;
106
- std::string_view msg ;
107
- std::string_view file ;
108
- int line ;
105
+ bool is_empty_ ;
106
+ std::string_view msg_ ;
107
+ std::string_view file_ ;
108
+ int line_ ;
109
109
};
110
110
111
111
static constexpr DebugInfoMatcher AnyMatcher (DebugInfoMatcher::any_msg);
@@ -144,7 +144,6 @@ struct DeathTest {
144
144
std::exit (RK_MatchFailure);
145
145
}
146
146
147
-
148
147
DeathTest (DebugInfoMatcher const & Matcher) : matcher_(Matcher) {}
149
148
150
149
template <class Func >
0 commit comments