Files
openwrt_yocto/poky/meta/lib/oeqa/selftest/cases/oelib/elf.py
T
francis.wang 4c86c082a2 Initial commit: OpenWrt-Yocto monorepo
Combine poky (Yocto scarthgap), meta-openembedded (scarthgap), and
meta-openwrt into a single repository.

Components:
- poky/             Yocto core framework (BitBake + OE-Core)
- meta-openembedded/ Community layers (meta-oe, meta-python, meta-networking)
- meta-openwrt/     OpenWrt customization layer
- setup-env.sh      One-click build environment setup
- README.md         Project documentation
2026-07-11 13:28:01 +08:00

29 lines
1.2 KiB
Python

#
# Copyright OpenEmbedded Contributors
#
# 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')")