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

Side by Side Diff: courgette/encode_decode_unittest.cc

Issue 2008253004: Refactor rel32 searching process for x64 to make it more similar to x86. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "courgette/assembly_program.h" 9 #include "courgette/assembly_program.h"
10 #include "courgette/base_test_unittest.h" 10 #include "courgette/base_test_unittest.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 EXPECT_EQ(0, memcmp(original_buffer, assembled_buffer, original_length)); 76 EXPECT_EQ(0, memcmp(original_buffer, assembled_buffer, original_length));
77 } 77 }
78 78
79 TEST_F(EncodeDecodeTest, PE) { 79 TEST_F(EncodeDecodeTest, PE) {
80 std::string file = FileContents("setup1.exe"); 80 std::string file = FileContents("setup1.exe");
81 TestAssembleToStreamDisassemble(file, 972845); 81 TestAssembleToStreamDisassemble(file, 972845);
82 } 82 }
83 83
84 TEST_F(EncodeDecodeTest, PE64) { 84 TEST_F(EncodeDecodeTest, PE64) {
85 std::string file = FileContents("chrome64_1.exe"); 85 std::string file = FileContents("chrome64_1.exe");
86 TestAssembleToStreamDisassemble(file, 809635); 86 TestAssembleToStreamDisassemble(file, 809776);
huangs 2016/05/26 18:34:34 So algorithm changed? Please separate pure refact
etiennep 2016/05/26 20:50:09 Done.
87 } 87 }
88 88
89 TEST_F(EncodeDecodeTest, Elf_Small) { 89 TEST_F(EncodeDecodeTest, Elf_Small) {
90 std::string file = FileContents("elf-32-1"); 90 std::string file = FileContents("elf-32-1");
91 TestAssembleToStreamDisassemble(file, 136201); 91 TestAssembleToStreamDisassemble(file, 136201);
92 } 92 }
93 93
94 TEST_F(EncodeDecodeTest, Elf_HighBSS) { 94 TEST_F(EncodeDecodeTest, Elf_HighBSS) {
95 std::string file = FileContents("elf-32-high-bss"); 95 std::string file = FileContents("elf-32-high-bss");
96 TestAssembleToStreamDisassemble(file, 7308); 96 TestAssembleToStreamDisassemble(file, 7308);
97 } 97 }
98 98
99 TEST_F(EncodeDecodeTest, Elf_Arm) { 99 TEST_F(EncodeDecodeTest, Elf_Arm) {
100 std::string file = FileContents("elf-armv7"); 100 std::string file = FileContents("elf-armv7");
101 TestAssembleToStreamDisassemble(file, 8531); 101 TestAssembleToStreamDisassemble(file, 8531);
102 } 102 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698