Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1896)

Unified Diff: courgette/disassembler_elf_32_x86_unittest.cc

Issue 2583373002: [Courgette] Simple AssemblyProgram and Disassembler cleanups. (Closed)
Patch Set: Tune up header inclusion. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « courgette/disassembler_elf_32.cc ('k') | courgette/disassembler_win32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/disassembler_elf_32_x86_unittest.cc
diff --git a/courgette/disassembler_elf_32_x86_unittest.cc b/courgette/disassembler_elf_32_x86_unittest.cc
index 29304219d78e7c59dc95bc14ca74abd6ca8c2986..902aeeec213daec27dc4bf7d481b394c5ce26adf 100644
--- a/courgette/disassembler_elf_32_x86_unittest.cc
+++ b/courgette/disassembler_elf_32_x86_unittest.cc
@@ -14,6 +14,7 @@
#include <string>
#include <vector>
+#include "base/memory/ptr_util.h"
#include "courgette/assembly_program.h"
#include "courgette/base_test_unittest.h"
#include "courgette/image_utils.h"
@@ -69,9 +70,8 @@ void DisassemblerElf32X86Test::TestExe(const char* file_name,
size_t expected_rel_count) const {
std::string file1 = FileContents(file_name);
- std::unique_ptr<TestDisassemblerElf32X86> disassembler(
- new TestDisassemblerElf32X86(
- reinterpret_cast<const uint8_t*>(file1.c_str()), file1.length()));
+ auto disassembler = base::MakeUnique<TestDisassemblerElf32X86>(
+ reinterpret_cast<const uint8_t*>(file1.c_str()), file1.length());
bool can_parse_header = disassembler->ParseHeader();
EXPECT_TRUE(can_parse_header);
@@ -89,7 +89,7 @@ void DisassemblerElf32X86Test::TestExe(const char* file_name,
EXPECT_EQ('L', offset_p[2]);
EXPECT_EQ('F', offset_p[3]);
- std::unique_ptr<AssemblyProgram> program(new AssemblyProgram(EXE_ELF_32_X86));
+ auto program = base::MakeUnique<AssemblyProgram>(EXE_ELF_32_X86, 0);
EXPECT_TRUE(disassembler->Disassemble(program.get()));
« no previous file with comments | « courgette/disassembler_elf_32.cc ('k') | courgette/disassembler_win32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698