From 09b056975dacd1f0f815ad820b6dc9913b0118a3 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 23 Jun 2020 18:55:43 -0400 Subject: fix pointer style to match the style guide We do this in a lot of places, but we're inconsistent. Normalize the code to the Google C++ style guide. Change-Id: Ic2aceab661ce8f6b993dda21b1cdf5d2198dcbbf Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2262932 Reviewed-by: Sterling Augustine Reviewed-by: Mark Mentovai --- src/processor/stackwalker_unittest_utils.h | 64 +++++++++++++++--------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'src/processor/stackwalker_unittest_utils.h') diff --git a/src/processor/stackwalker_unittest_utils.h b/src/processor/stackwalker_unittest_utils.h index 3a92a5ea..2905ea06 100644 --- a/src/processor/stackwalker_unittest_utils.h +++ b/src/processor/stackwalker_unittest_utils.h @@ -57,7 +57,7 @@ class MockMemoryRegion: public google_breakpad::MemoryRegion { // Set this region's address and contents. If we have placed an // instance of this class in a test fixture class, individual tests // can use this to provide the region's contents. - void Init(uint64_t base_address, const string &contents) { + void Init(uint64_t base_address, const string& contents) { base_address_ = base_address; contents_ = contents; } @@ -65,16 +65,16 @@ class MockMemoryRegion: public google_breakpad::MemoryRegion { uint64_t GetBase() const { return base_address_; } uint32_t GetSize() const { return contents_.size(); } - bool GetMemoryAtAddress(uint64_t address, uint8_t *value) const { + bool GetMemoryAtAddress(uint64_t address, uint8_t* value) const { return GetMemoryLittleEndian(address, value); } - bool GetMemoryAtAddress(uint64_t address, uint16_t *value) const { + bool GetMemoryAtAddress(uint64_t address, uint16_t* value) const { return GetMemoryLittleEndian(address, value); } - bool GetMemoryAtAddress(uint64_t address, uint32_t *value) const { + bool GetMemoryAtAddress(uint64_t address, uint32_t* value) const { return GetMemoryLittleEndian(address, value); } - bool GetMemoryAtAddress(uint64_t address, uint64_t *value) const { + bool GetMemoryAtAddress(uint64_t address, uint64_t* value) const { return GetMemoryLittleEndian(address, value); } void Print() const { @@ -85,7 +85,7 @@ class MockMemoryRegion: public google_breakpad::MemoryRegion { // Fetch a little-endian value from ADDRESS in contents_ whose size // is BYTES, and store it in *VALUE. Return true on success. template - bool GetMemoryLittleEndian(uint64_t address, ValueType *value) const { + bool GetMemoryLittleEndian(uint64_t address, ValueType* value) const { if (address < base_address_ || address - base_address_ + sizeof(ValueType) > contents_.size()) return false; @@ -105,7 +105,7 @@ class MockMemoryRegion: public google_breakpad::MemoryRegion { class MockCodeModule: public google_breakpad::CodeModule { public: MockCodeModule(uint64_t base_address, uint64_t size, - const string &code_file, const string &version) + const string& code_file, const string& version) : base_address_(base_address), size_(size), code_file_(code_file) { } uint64_t base_address() const { return base_address_; } @@ -115,7 +115,7 @@ class MockCodeModule: public google_breakpad::CodeModule { string debug_file() const { return code_file_; } string debug_identifier() const { return code_file_; } string version() const { return version_; } - google_breakpad::CodeModule *Copy() const { + google_breakpad::CodeModule* Copy() const { abort(); // Tests won't use this. } virtual bool is_unloaded() const { return false; } @@ -134,16 +134,16 @@ class MockCodeModules: public google_breakpad::CodeModules { typedef google_breakpad::CodeModule CodeModule; typedef google_breakpad::CodeModules CodeModules; - void Add(const MockCodeModule *module) { + void Add(const MockCodeModule* module) { modules_.push_back(module); } unsigned int module_count() const { return modules_.size(); } - const CodeModule *GetModuleForAddress(uint64_t address) const { + const CodeModule* GetModuleForAddress(uint64_t address) const { for (ModuleVector::const_iterator i = modules_.begin(); i != modules_.end(); i++) { - const MockCodeModule *module = *i; + const MockCodeModule* module = *i; if (module->base_address() <= address && address - module->base_address() < module->size()) return module; @@ -151,17 +151,17 @@ class MockCodeModules: public google_breakpad::CodeModules { return NULL; }; - const CodeModule *GetMainModule() const { return modules_[0]; } + const CodeModule* GetMainModule() const { return modules_[0]; } - const CodeModule *GetModuleAtSequence(unsigned int sequence) const { + const CodeModule* GetModuleAtSequence(unsigned int sequence) const { return modules_.at(sequence); } - const CodeModule *GetModuleAtIndex(unsigned int index) const { + const CodeModule* GetModuleAtIndex(unsigned int index) const { return modules_.at(index); } - CodeModules *Copy() const { abort(); } // Tests won't use this + CodeModules* Copy() const { abort(); } // Tests won't use this virtual std::vector > GetShrunkRangeModules() const { @@ -169,7 +169,7 @@ class MockCodeModules: public google_breakpad::CodeModules { } private: - typedef std::vector ModuleVector; + typedef std::vector ModuleVector; ModuleVector modules_; }; @@ -177,26 +177,26 @@ class MockSymbolSupplier: public google_breakpad::SymbolSupplier { public: typedef google_breakpad::CodeModule CodeModule; typedef google_breakpad::SystemInfo SystemInfo; - MOCK_METHOD3(GetSymbolFile, SymbolResult(const CodeModule *module, - const SystemInfo *system_info, - string *symbol_file)); - MOCK_METHOD4(GetSymbolFile, SymbolResult(const CodeModule *module, - const SystemInfo *system_info, - string *symbol_file, - string *symbol_data)); - MOCK_METHOD5(GetCStringSymbolData, SymbolResult(const CodeModule *module, - const SystemInfo *system_info, - string *symbol_file, - char **symbol_data, - size_t *symbol_data_size)); - MOCK_METHOD1(FreeSymbolData, void(const CodeModule *module)); + MOCK_METHOD3(GetSymbolFile, SymbolResult(const CodeModule* module, + const SystemInfo* system_info, + string* symbol_file)); + MOCK_METHOD4(GetSymbolFile, SymbolResult(const CodeModule* module, + const SystemInfo* system_info, + string* symbol_file, + string* symbol_data)); + MOCK_METHOD5(GetCStringSymbolData, SymbolResult(const CodeModule* module, + const SystemInfo* system_info, + string* symbol_file, + char** symbol_data, + size_t* symbol_data_size)); + MOCK_METHOD1(FreeSymbolData, void(const CodeModule* module)); // Copies the passed string contents into a newly allocated buffer. // The newly allocated buffer will be freed during destruction. - char* CopySymbolDataAndOwnTheCopy(const string &info, - size_t *symbol_data_size) { + char* CopySymbolDataAndOwnTheCopy(const string& info, + size_t* symbol_data_size) { *symbol_data_size = info.size() + 1; - char *symbol_data = new char[*symbol_data_size]; + char* symbol_data = new char[*symbol_data_size]; memcpy(symbol_data, info.c_str(), info.size()); symbol_data[info.size()] = '\0'; symbol_data_to_free_.push_back(symbol_data); -- cgit v1.2.1