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

Side by Side Diff: courgette/adjustment_method_unittest.cc

Issue 2771753004: [Courgette] Refactor: Unify Disassembler::Disassemble() and instantiate AssemblyProgram there. (Closed)
Patch Set: Fix signed/unsigned comparison issue in test. Created 3 years, 9 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
« no previous file with comments | « courgette/BUILD.gn ('k') | courgette/assembly_program.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <memory> 5 #include <memory>
6 #include <string> 6 #include <string>
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 abs32_rvas.push_back(kRvaB); 45 abs32_rvas.push_back(kRvaB);
46 std::vector<RVA> rel32_rvas; // Stub. 46 std::vector<RVA> rel32_rvas; // Stub.
47 47
48 TrivialRvaVisitor abs32_visitor(abs32_rvas); 48 TrivialRvaVisitor abs32_visitor(abs32_rvas);
49 TrivialRvaVisitor rel32_visitor(rel32_rvas); 49 TrivialRvaVisitor rel32_visitor(rel32_rvas);
50 prog->PrecomputeLabels(&abs32_visitor, &rel32_visitor); 50 prog->PrecomputeLabels(&abs32_visitor, &rel32_visitor);
51 51
52 Label* labelA = prog->FindAbs32Label(kRvaA); 52 Label* labelA = prog->FindAbs32Label(kRvaA);
53 Label* labelB = prog->FindAbs32Label(kRvaB); 53 Label* labelB = prog->FindAbs32Label(kRvaB);
54 54
55 AssemblyProgram::InstructionGenerator gen = base::Bind( 55 InstructionGenerator gen = base::Bind(
56 [](Label* labelA, Label* labelB, AssemblyProgram* prog, 56 [](Label* labelA, Label* labelB,
57 InstructionReceptor* receptor) -> CheckBool { 57 InstructionReceptor* receptor) -> CheckBool {
58 EXPECT_TRUE(receptor->EmitAbs32(labelA)); 58 EXPECT_TRUE(receptor->EmitAbs32(labelA));
59 EXPECT_TRUE(receptor->EmitAbs32(labelA)); 59 EXPECT_TRUE(receptor->EmitAbs32(labelA));
60 EXPECT_TRUE(receptor->EmitAbs32(labelB)); 60 EXPECT_TRUE(receptor->EmitAbs32(labelB));
61 EXPECT_TRUE(receptor->EmitAbs32(labelA)); 61 EXPECT_TRUE(receptor->EmitAbs32(labelA));
62 EXPECT_TRUE(receptor->EmitAbs32(labelA)); 62 EXPECT_TRUE(receptor->EmitAbs32(labelA));
63 EXPECT_TRUE(receptor->EmitAbs32(labelB)); 63 EXPECT_TRUE(receptor->EmitAbs32(labelB));
64 return true; 64 return true;
65 }, 65 },
66 labelA, labelB); 66 labelA, labelB);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 EXPECT_TRUE(s5 == s6); // Adjustment did change B into A 131 EXPECT_TRUE(s5 == s6); // Adjustment did change B into A
132 } 132 }
133 133
134 TEST_F(AdjustmentMethodTest, All) { 134 TEST_F(AdjustmentMethodTest, All) {
135 Test1(); 135 Test1();
136 } 136 }
137 137
138 } // namespace 138 } // namespace
139 139
140 } // namespace courgette 140 } // namespace courgette
OLDNEW
« no previous file with comments | « courgette/BUILD.gn ('k') | courgette/assembly_program.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698