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

Side by Side Diff: courgette/image_info_unittest.cc

Issue 8344037: Start refactoring to reduce executable type knowledge. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix comment. Created 9 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « courgette/image_info.cc ('k') | courgette/versioning_unittest.cc » ('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 "courgette/base_test_unittest.h" 5 #include "courgette/base_test_unittest.h"
6 #include "courgette/image_info.h" 6 #include "courgette/image_info.h"
7 7
8 class ImageInfoTest : public BaseTest { 8 class ImageInfoTest : public BaseTest {
9 public: 9 public:
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 EXPECT_EQ('M', p[0]); 52 EXPECT_EQ('M', p[0]);
53 EXPECT_EQ('Z', p[1]); 53 EXPECT_EQ('Z', p[1]);
54 } 54 }
55 55
56 void ImageInfoTest::TestResourceDll() const { 56 void ImageInfoTest::TestResourceDll() const {
57 std::string file1 = FileContents("en-US.dll"); 57 std::string file1 = FileContents("en-US.dll");
58 58
59 scoped_ptr<courgette::PEInfo> info(new courgette::PEInfo()); 59 scoped_ptr<courgette::PEInfo> info(new courgette::PEInfo());
60 info->Init(reinterpret_cast<const uint8*>(file1.c_str()), file1.length()); 60 info->Init(reinterpret_cast<const uint8*>(file1.c_str()), file1.length());
61 61
62 // This is expected to fail, since we don't really support them yet.
62 bool can_parse_header = info->ParseHeader(); 63 bool can_parse_header = info->ParseHeader();
63 EXPECT_TRUE(can_parse_header); 64 EXPECT_FALSE(can_parse_header);
64 65
65 // The executable is the whole file, not 'embedded' with the file 66 // The executable is the whole file, not 'embedded' with the file
66 EXPECT_EQ(file1.length(), info->length()); 67 EXPECT_EQ(file1.length(), info->length());
67 68
68 EXPECT_TRUE(info->ok()); 69 EXPECT_FALSE(info->ok());
69 EXPECT_FALSE(info->has_text_section()); 70 EXPECT_FALSE(info->has_text_section());
70 EXPECT_EQ(0U, info->size_of_code()); 71 EXPECT_EQ(0U, info->size_of_code());
71 } 72 }
72 73
73 TEST_F(ImageInfoTest, All) { 74 TEST_F(ImageInfoTest, All) {
74 TestExe(); 75 TestExe();
75 TestResourceDll(); 76 TestResourceDll();
76 } 77 }
OLDNEW
« no previous file with comments | « courgette/image_info.cc ('k') | courgette/versioning_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698