OLD | NEW |
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 "courgette/disassembler_win32_x86.h" | 5 #include "courgette/disassembler_win32_x86.h" |
6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" |
7 #include "courgette/base_test_unittest.h" | 8 #include "courgette/base_test_unittest.h" |
8 | 9 |
9 class DisassemblerWin32X86Test : public BaseTest { | 10 class DisassemblerWin32X86Test : public BaseTest { |
10 public: | 11 public: |
11 | |
12 void TestExe() const; | 12 void TestExe() const; |
13 void TestExe64() const; | 13 void TestExe64() const; |
14 void TestResourceDll() const; | 14 void TestResourceDll() const; |
15 }; | 15 }; |
16 | 16 |
17 void DisassemblerWin32X86Test::TestExe() const { | 17 void DisassemblerWin32X86Test::TestExe() const { |
18 std::string file1 = FileContents("setup1.exe"); | 18 std::string file1 = FileContents("setup1.exe"); |
19 | 19 |
20 scoped_ptr<courgette::DisassemblerWin32X86> disassembler( | 20 scoped_ptr<courgette::DisassemblerWin32X86> disassembler( |
21 new courgette::DisassemblerWin32X86(file1.c_str(), file1.length())); | 21 new courgette::DisassemblerWin32X86(file1.c_str(), file1.length())); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 EXPECT_FALSE(disassembler->has_text_section()); | 89 EXPECT_FALSE(disassembler->has_text_section()); |
90 EXPECT_EQ(0U, disassembler->size_of_code()); | 90 EXPECT_EQ(0U, disassembler->size_of_code()); |
91 EXPECT_TRUE(disassembler->is_32bit()); | 91 EXPECT_TRUE(disassembler->is_32bit()); |
92 } | 92 } |
93 | 93 |
94 TEST_F(DisassemblerWin32X86Test, All) { | 94 TEST_F(DisassemblerWin32X86Test, All) { |
95 TestExe(); | 95 TestExe(); |
96 TestExe64(); | 96 TestExe64(); |
97 TestResourceDll(); | 97 TestResourceDll(); |
98 } | 98 } |
OLD | NEW |