Files
poky/meta/lib/oeqa/selftest/cases/oelib/elf.py
Ross Burton 949646a9e9 lib/oe/qa: handle the 'no specific instruction set' ELF e_machine value
[RP: Update OEQA selftest to match change]
(From OE-Core rev: b7cfc0f51cc0b4866f913f6eae4fcc6f72d2578c)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-20 00:03:05 +00:00

27 lines
1.1 KiB
Python

#
# SPDX-License-Identifier: MIT
#
from unittest.case import TestCase
import oe.qa
class TestElf(TestCase):
def test_machine_name(self):
"""
Test elf_machine_to_string()
"""
self.assertEqual(oe.qa.elf_machine_to_string(0x02), "SPARC")
self.assertEqual(oe.qa.elf_machine_to_string(0x03), "x86")
self.assertEqual(oe.qa.elf_machine_to_string(0x08), "MIPS")
self.assertEqual(oe.qa.elf_machine_to_string(0x14), "PowerPC")
self.assertEqual(oe.qa.elf_machine_to_string(0x28), "ARM")
self.assertEqual(oe.qa.elf_machine_to_string(0x2A), "SuperH")
self.assertEqual(oe.qa.elf_machine_to_string(0x32), "IA-64")
self.assertEqual(oe.qa.elf_machine_to_string(0x3E), "x86-64")
self.assertEqual(oe.qa.elf_machine_to_string(0xB7), "AArch64")
self.assertEqual(oe.qa.elf_machine_to_string(0xF7), "BPF")
self.assertEqual(oe.qa.elf_machine_to_string(0x00), "Unset")
self.assertEqual(oe.qa.elf_machine_to_string(0xDEADBEEF), "Unknown (3735928559)")
self.assertEqual(oe.qa.elf_machine_to_string("foobar"), "Unknown ('foobar')")