From 1fa7c1c4c4195aa95b87b86752770bb7e1ad0f4c Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Thu, 16 Sep 2010 22:37:24 +0000 Subject: Fix compilation of file_id_unittest. Review URL: http://breakpad.appspot.com/198001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@689 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/common/linux/file_id_unittest.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/common/linux/file_id_unittest.cc') diff --git a/src/common/linux/file_id_unittest.cc b/src/common/linux/file_id_unittest.cc index e28a2f09..f5298b12 100644 --- a/src/common/linux/file_id_unittest.cc +++ b/src/common/linux/file_id_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009, Google Inc. +// Copyright (c) 2010, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -37,7 +37,6 @@ using namespace google_breakpad; - namespace { typedef testing::Test FileIDTest; } @@ -90,13 +89,14 @@ struct ElfClass64 { template struct ElfishElf { + static const size_t kTextSectionSize = 128; typedef typename ElfClass::Ehdr Ehdr; typedef typename ElfClass::Shdr Shdr; Ehdr elf_header; Shdr text_header; Shdr string_header; - char text_section[128]; + char text_section[kTextSectionSize]; char string_section[8]; static void Populate(ElfishElf* elf) { @@ -109,8 +109,8 @@ struct ElfishElf { elf->text_header.sh_name = 0; elf->text_header.sh_type = SHT_PROGBITS; elf->text_header.sh_offset = offsetof(ElfishElf, text_section); - elf->text_header.sh_size = sizeof(text_section); - for (size_t i = 0; i < sizeof(text_section); ++i) { + elf->text_header.sh_size = kTextSectionSize; + for (size_t i = 0; i < kTextSectionSize; ++i) { elf->text_section[i] = i * 3; } elf->string_header.sh_offset = offsetof(ElfishElf, string_section); -- cgit v1.2.1