diff options
author | Alex Deymo <deymo@chromium.org> | 2014-08-08 13:16:23 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-08-09 04:43:59 +0000 |
commit | c1711e203f14111a5384860ad1a3ddf07c9d01ed (patch) | |
tree | 56614c87ddfe1523af66e5e2f7c2e32ae5a872d9 /utils_unittest.cc | |
parent | 5b2a5e8c87edfff2ac526dc6d87997b5d6ed5d05 (diff) |
update_engine: Use constants from elf.h.
This patch changes GetFileFormatELF() to use the constants from elf.h
and includes the mips architecture.
BUG=chromium:401873
TEST=FEATURES=test emerge-link update_engine
Change-Id: I4d2924f121cd56dc80b8099b46f4456ebb3dfefc
Reviewed-on: https://chromium-review.googlesource.com/211662
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Diffstat (limited to 'utils_unittest.cc')
-rw-r--r-- | utils_unittest.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/utils_unittest.cc b/utils_unittest.cc index aa1f9196..53e4428a 100644 --- a/utils_unittest.cc +++ b/utils_unittest.cc @@ -11,8 +11,8 @@ #include <string> #include <vector> -#include <base/files/file_path.h> #include <base/file_util.h> +#include <base/files/file_path.h> #include <base/strings/string_util.h> #include <base/strings/stringprintf.h> #include <gtest/gtest.h> @@ -380,6 +380,14 @@ TEST(UtilsTest, GetFileFormatTest) { 0x02, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x90, 0x83, 0x04, 0x08, 0x34, 0x00, 0x00, 0x00}); + // ELF 32-bit LSB executable, MIPS + GetFileFormatTester( + "ELF 32-bit little-endian mips", + vector<uint8_t>{0x7f, 0x45, 0x4c, 0x46, 0x01, 0x01, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, + 0xc0, 0x12, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00}); + // ELF 32-bit LSB executable, ARM GetFileFormatTester( "ELF 32-bit little-endian arm", |