Ralph Mietzner

32 papers A 2B 2C 2Journal 6Unranked 19
YearRankTypeTitle / Venue / Authors
2011 J jnl
it Inf. Technol.
Christoph Fehling, Ralph Mietzner
2011 conf
IEEE CLOUD
Christoph Fehling, Frank Leymann, David Schumm, Ralf Konrad, Ralph Mietzner, Michael Pauly
2011 J jnl
Enterp. Inf. Syst.
Ralph Mietzner, Frank Leymann, Tobias Unger
2011 J jnl
Int. J. Cooperative Inf. Syst.
Frank Leymann, Christoph Fehling, Ralph Mietzner, Alexander Nowak, Schahram Dustdar
2011 conf
ECIS
David Schumm, Gregor Latuske, Frank Leymann, Ralph Mietzner, Thorsten Scheibler
2010 conf
IEEE CLOUD
Christoph Fehling, Frank Leymann, Ralph Mietzner
2010
Ralph Mietzner
2010 conf
SOCA
Ralph Mietzner, Frank Leymann
2010 conf
ICSOC Workshops
Lukasz Juszczyk, Daniel Schall, Ralph Mietzner, Schahram Dustdar, Frank Leymann
2010 A conf
ICSOC
Gabriela Gheorghe, Bruno Crispo, Daniel Schleicher, Tobias Anstett, Frank Leymann, Ralph Mietzner, Ganna Monakova
2010 conf
SOCA
Ralph Mietzner, Christoph Fehling, Dimka Karastoyanova, Frank Leymann
2010 C conf
CloudCom
Immanuel Trummer, Frank Leymann, Ralph Mietzner, Walter Binder
2010 conf
ICSOC Workshops
Alexander Nowak, Frank Leymann, Ralph Mietzner
2009 J jnl
Trans. Petri Nets Other Model. Concurr.
Ralph Mietzner, Dimka Karastoyanova, Frank Leymann
2009 conf
OTM Conferences (1)
Ralph Mietzner, Tobias Unger, Frank Leymann
2009 B conf
EDOC
Ralph Mietzner, Tobias Unger, Robert Titze, Frank Leymann
2009 J jnl
Enterp. Inf. Syst.
Tobias Unger, Ralph Mietzner, Frank Leymann
2009 J jnl
Enterp. Inf. Syst.
Thorsten Scheibler, Ralph Mietzner, Frank Leymann
2009 conf
ICSOC/ServiceWave
Tobias Anstett, Dimka Karastoyanova, Frank Leymann, Ralph Mietzner, Ganna Monakova, Daniel Schleicher, Steve Strauch
2009 conf
OTM Conferences (1)
Daniel Schleicher, Tobias Anstett, Frank Leymann, Ralph Mietzner
2009 conf
OTM Conferences (1)
Oliver Kopp, Ralph Mietzner, Frank Leymann
2009 conf
SERVICES I
Tobias Anstett, Frank Leymann, Ralph Mietzner, Steve Strauch
2009 conf
PESOS@ICSE
Ralph Mietzner, Andreas Metzger, Frank Leymann, Klaus Pohl
2009 A conf
ICWS
Ralph Mietzner, Tammo van Lessen, Alexander Wiese, Matthias Wieland, Dimka Karastoyanova, Frank Leymann
2008 conf
ECOWS
Tammo van Lessen, Frank Leymann, Ralph Mietzner, Jörg Nitzsche, Daniel Schleicher
2008 conf
Business Process Management Workshops
Oliver Kopp, Branimir Wetzstein, Ralph Mietzner, Stefan Pottinger, Dimka Karastoyanova, Frank Leymann
2008 conf
Multikonferenz Wirtschaftsinformatik
Ralph Mietzner, Zhilei Ma, Frank Leymann
2008 C conf
ICIW
Ralph Mietzner, Frank Leymann, Mike P. Papazoglou
2008 B conf
EDOC
Thorsten Scheibler, Ralph Mietzner, Frank Leymann
2008 conf
IEEE SCC (2)
Ralph Mietzner, Frank Leymann
2008 conf
SERVICES I
Ralph Mietzner, Frank Leymann
2007 conf
OTM Conferences (1)
Stefan Pottinger, Ralph Mietzner, Frank Leymann
tests/unit/test_decompile_function_type.py
← Index tests/unit/test_decompile_function_type.py python
"""Unit tests for bninja/function_type.py."""
import sys
import pytest
from unittest.mock import MagicMock

# Install binaryninja stubs before importing
from tests.unit.conftest_binja_stubs import install_binja_stubs, SymbolType
install_binja_stubs()

from redb.extractors.decompiler.bninja.function_type import (
    FunctionType,
    FunctionTypeAnalysis,
)


# ============================================================================
# 4a. FunctionType / FunctionTypeAnalysis
# ============================================================================


class TestFunctionTypeEnum:
    def test_function_type_enum_values(self):
        assert FunctionType.USER.value == "USER"
        assert FunctionType.LIBRARY.value == "LIBRARY"
        assert FunctionType.EXTERNAL.value == "EXTERNAL"
        assert FunctionType.THUNK.value == "THUNK"
        assert FunctionType.UNKNOWN.value == "UNKNOWN"


class TestFunctionTypeAnalysis:
    def _make_function(self, symbol_type=None, is_thunk=False, raise_on_symbol=False):
        func = MagicMock()
        func.is_thunk = is_thunk
        if raise_on_symbol:
            type(func).symbol = property(lambda self: (_ for _ in ()).throw(Exception("no symbol")))
        else:
            func.symbol.type = symbol_type if symbol_type is not None else SymbolType.FunctionSymbol
        return func

    def test_user_function_type(self):
        func = self._make_function(symbol_type=SymbolType.FunctionSymbol)
        analysis = FunctionTypeAnalysis(func)
        assert analysis.get_function_type() == FunctionType.USER

    def test_external_function_type(self):
        func = self._make_function(symbol_type=SymbolType.ImportedFunctionSymbol)
        analysis = FunctionTypeAnalysis(func)
        assert analysis.get_function_type() == FunctionType.EXTERNAL

    def test_library_function_type(self):
        func = self._make_function(symbol_type=SymbolType.LibraryFunctionSymbol)
        analysis = FunctionTypeAnalysis(func)
        assert analysis.get_function_type() == FunctionType.LIBRARY

    def test_thunk_function_type(self):
        # Thunk overrides the symbol type
        func = self._make_function(
            symbol_type=SymbolType.FunctionSymbol, is_thunk=True
        )
        analysis = FunctionTypeAnalysis(func)
        assert analysis.get_function_type() == FunctionType.THUNK

    def test_exception_returns_unknown(self):
        func = self._make_function(raise_on_symbol=True)
        analysis = FunctionTypeAnalysis(func)
        assert analysis.get_function_type() == FunctionType.UNKNOWN