Nelson H. Weiderman

19 papers A* 1A 1Journal 4Unranked 12
YearRankTypeTitle / Venue / Authors
1998 conf
ESPRIT ARES Workshop
Nelson H. Weiderman, John Bergey, Dennis B. Smith, Scott R. Tilley
1998 J jnl
ACM SIGSOFT Softw. Eng. Notes
Paul C. Clements, Nelson H. Weiderman
1995 conf
ESEC
Alan W. Brown, David J. Carney, Paul C. Clements, B. Craig Meyers, Dennis B. Smith, Nelson H. Weiderman, William G. Wood
1995 conf
TRI-Ada
Linda Safford, Phil Brashear, Oliver Cole, Robert Dewar, Nelson H. Weiderman
1992 conf
TRI-Ada
Nelson H. Weiderman
1992 J jnl
Real Time Syst.
Nelson H. Weiderman, Nick I. Kamenoff
1991 A conf
RTSS
Nick I. Kamenoff, Nelson H. Weiderman
1990 conf
TRI-Ada
Nelson H. Weiderman, Patrick Donohoe, Ruth Shapiro
1990 conf
Working Group on Ada Performance Issues
Nelson H. Weiderman
1989 conf
TRI-Ada
Dudrey Smith, Nelson H. Weiderman
1988 conf
IRTAW
Mark W. Borger, Mark H. Klein, Nelson H. Weiderman
1988 conf
TRI-Ada
Nelson H. Weiderman
1987 A* conf
ICSE
Nelson H. Weiderman
1986 conf
SDE
Nelson H. Weiderman, A. Nico Habermann, Mark W. Borger, Mark H. Klein
1985 conf
WADAS
Nelson H. Weiderman, Catherine W. Johnson
1975 J jnl
Softw. Pract. Exp.
Alan C. Shaw, Nelson H. Weiderman, Gregory R. Andrews, Mary-Beth Felcyn, John E. Rieber, Gain Wong
1975 J jnl
ACM SIGPLAN Notices
Nelson H. Weiderman, B. M. Rawson
1971 conf
IFIP Congress (2)
Alan C. Shaw, Nelson H. Weiderman
1971
Synchronization & Simulation in Operating System Construction.
Nelson H. Weiderman
tests/unit/test_decompile_arch.py
← Index tests/unit/test_decompile_arch.py python
"""Unit tests for architecture modules:
- bninja/arch/creator.py
- bninja/arch/x86.py
"""
import sys
import pytest

# Install binaryninja stubs before importing arch modules
from tests.unit.conftest_binja_stubs import install_binja_stubs
install_binja_stubs()

from redb.extractors.decompiler.bninja.arch.creator import ArchitectureCreator
from redb.extractors.decompiler.bninja.arch.x86 import Arch_x86


# ============================================================================
# 3a. ArchitectureCreator
# ============================================================================

class TestArchitectureCreator:
    def test_create_x86(self):
        arch = ArchitectureCreator("x86").get()
        assert isinstance(arch, Arch_x86)

    def test_create_x86_case_insensitive(self):
        for name in ["X86", "x86", "X86"]:
            arch = ArchitectureCreator(name).get()
            assert isinstance(arch, Arch_x86)

    def test_unsupported_arch_raises(self):
        with pytest.raises(ValueError, match="Unsupported architecture"):
            ArchitectureCreator("arm").get()


# ============================================================================
# 3b. Arch_x86
# ============================================================================

class TestArch_x86Registers:
    def setup_method(self):
        self.arch = Arch_x86()

    def test_is_register_valid(self):
        assert self.arch.is_register("RAX") is True
        assert self.arch.is_register("eax") is True
        assert self.arch.is_register("XMM0") is True

    def test_is_register_invalid(self):
        assert self.arch.is_register("INVALID_REG") is False

    def test_is_general_purpose_register(self):
        assert self.arch.is_general_purpose_register("RAX") is True
        assert self.arch.is_general_purpose_register("XMM0") is False

    def test_is_stack_register(self):
        assert self.arch.is_stack_register("RSP") is True
        assert self.arch.is_stack_register("RBP") is True
        assert self.arch.is_stack_register("RAX") is False

    def test_is_xmm_register(self):
        assert self.arch.is_xmm_register("XMM0") is True
        assert self.arch.is_xmm_register("RAX") is False


class TestArch_x86OpcodeCategories:
    def setup_method(self):
        self.arch = Arch_x86()

    def test_opcode_categories_populated(self):
        assert len(self.arch.opcode_categories) > 0

    def test_opcode_mov_category(self):
        assert self.arch.opcode_categories["MOV"] == "DATA_MOVEMENT"

    def test_opcode_call_category(self):
        assert self.arch.opcode_categories["CALL"] == "CONTROL_FLOW"

    def test_opcode_add_category(self):
        assert self.arch.opcode_categories["ADD"] == "ARITHMETIC"


class TestArch_x86ControlFlow:
    def setup_method(self):
        self.arch = Arch_x86()

    def test_is_control_flow_instruction_by_mnemonic(self):
        assert self.arch.is_control_flow_instruction_by_mnemonic("JMP") is True
        assert self.arch.is_control_flow_instruction_by_mnemonic("MOV") is False

    def test_is_control_flow_instruction_call(self):
        assert self.arch.is_control_flow_instruction_by_mnemonic("CALL") is True

    def test_is_control_flow_instruction_ret(self):
        assert self.arch.is_control_flow_instruction_by_mnemonic("RET") is True

    def test_is_control_flow_instruction_loop(self):
        assert self.arch.is_control_flow_instruction_by_mnemonic("LOOP") is True

    def test_is_control_flow_instruction_empty(self):
        assert self.arch.is_control_flow_instruction_by_mnemonic("") is False
        assert self.arch.is_control_flow_instruction_by_mnemonic(None) is False