Style updates, mostly _ naming (#970)

There are some declaration order changes, and a few test classes switched from `struct` to `class`. However, this PR is mostly adopting `_` naming of private member variables due to the shift in naming style. None of what's here should have behavior impacts, it should just be style.

Note, there are a lot of things that *look* like they could be accessor-named, but I'm not doing that in this change. Happy to do it separately if you want me to do another PR focused on it.

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
This commit is contained in:
Jon Meow
2021-12-07 09:46:44 -08:00
committed by GitHub
co-authored by Chandler Carruth
parent be8d0a993b
commit 652cd8c636
29 changed files with 491 additions and 481 deletions
+15 -14
View File
@@ -22,21 +22,11 @@ namespace Yaml = Carbon::Testing::Yaml;
/// A raw_ostream that makes it easy to repeatedly check streamed output.
class RawTestOstream : public llvm::raw_ostream {
std::string buffer;
void write_impl(const char* ptr, size_t size) override {
buffer.append(ptr, ptr + size);
}
[[nodiscard]] auto current_pos() const -> uint64_t override {
return buffer.size();
}
public:
~RawTestOstream() override {
flush();
if (!buffer.empty()) {
ADD_FAILURE() << "Unchecked output:\n" << buffer;
if (!buffer_.empty()) {
ADD_FAILURE() << "Unchecked output:\n" << buffer_;
}
}
@@ -44,10 +34,21 @@ class RawTestOstream : public llvm::raw_ostream {
/// back to empty.
auto TakeStr() -> std::string {
flush();
std::string result = std::move(buffer);
buffer.clear();
std::string result = std::move(buffer_);
buffer_.clear();
return result;
}
private:
void write_impl(const char* ptr, size_t size) override {
buffer_.append(ptr, ptr + size);
}
[[nodiscard]] auto current_pos() const -> uint64_t override {
return buffer_.size();
}
std::string buffer_;
};
TEST(DriverTest, FullCommandErrors) {