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

Side by Side Diff: courgette/rel32_finder_win32_x86_unittest.cc

Issue 1676683002: [Courgette] Clean up Disassembler; fix ELF Memory leaks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wrap #include <iostream> under #if COURGETTE_HISTOGRAM_TARGETS. Created 4 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/rel32_finder_win32_x86.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "courgette/rel32_finder_win32_x86.h" 5 #include "courgette/rel32_finder_win32_x86.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 15 matching lines...) Expand all
26 Rel32FinderWin32X86TestCase(const std::string& test_data) 26 Rel32FinderWin32X86TestCase(const std::string& test_data)
27 : text_start_rva_(0), 27 : text_start_rva_(0),
28 text_end_rva_(0), 28 text_end_rva_(0),
29 relocs_start_rva_(0), 29 relocs_start_rva_(0),
30 relocs_end_rva_(0), 30 relocs_end_rva_(0),
31 image_end_rva_(0) { 31 image_end_rva_(0) {
32 LoadTestFromString(test_data); 32 LoadTestFromString(test_data);
33 } 33 }
34 34
35 void RunTestBasic(std::string name) { 35 void RunTestBasic(std::string name) {
36 Rel32FinderWin32X86_Basic finder(relocs_start_rva_, relocs_end_rva_, 36 Rel32FinderWin32X86_Basic finder(relocs_start_rva_, relocs_end_rva_);
37 image_end_rva_);
38 ASSERT_FALSE(text_data_.empty()); 37 ASSERT_FALSE(text_data_.empty());
39 finder.Find(&text_data_[0], &text_data_[0] + text_data_.size(), 38 finder.Find(&text_data_[0], &text_data_[0] + text_data_.size(),
40 text_start_rva_, text_end_rva_, abs32_locations_); 39 text_start_rva_, text_end_rva_, abs32_locations_);
41 std::vector<RVA> rel32_locations; 40 std::vector<RVA> rel32_locations;
42 finder.SwapRel32Locations(&rel32_locations); 41 finder.SwapRel32Locations(&rel32_locations);
43 EXPECT_EQ(expected_rel32_locations_, rel32_locations) 42 EXPECT_EQ(expected_rel32_locations_, rel32_locations)
44 << "From test case " << name << " (addresses are in hex)"; 43 << "From test case " << name << " (addresses are in hex)";
45 } 44 }
46 45
47 private: 46 private:
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 TEST_F(Rel32FinderWin32X86Test, TestBasic) { 142 TEST_F(Rel32FinderWin32X86Test, TestBasic) {
144 RunTest("rel32_win32_x86_01.txt"); 143 RunTest("rel32_win32_x86_01.txt");
145 RunTest("rel32_win32_x86_02.txt"); 144 RunTest("rel32_win32_x86_02.txt");
146 RunTest("rel32_win32_x86_03.txt"); 145 RunTest("rel32_win32_x86_03.txt");
147 RunTest("rel32_win32_x86_04.txt"); 146 RunTest("rel32_win32_x86_04.txt");
148 } 147 }
149 148
150 } // namespace 149 } // namespace
151 150
152 } // namespace courgette 151 } // namespace courgette
OLDNEW
« no previous file with comments | « courgette/rel32_finder_win32_x86.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698