Carol J. Romanowski

21 papers A 1B 2C 5Journal 4Unranked 8
YearRankTypeTitle / Venue / Authors
2021 A conf
SIGCSE
Jean R. S. Blair, Lawrence Jones, Paul M. Leidig, Scott Murray, Rajendra K. Raj, Carol J. Romanowski
2021 conf
ICHI
Asma Alnemari, Rajendra K. Raj, Carol J. Romanowski, Sumita Mishra
2020 conf
ITiCSE-WGR
Rajendra K. Raj, Carol J. Romanowski, John Impagliazzo, Sherif G. Aly, Brett A. Becker, Juan Chen, Sheikh K. Ghafoor, Nasser Giacaman, Steven I. Gordon, Cruz Izu, Shahram Rahimi, Michael P. Robson, Neena Thota
2020 B conf
ITiCSE
Rajendra K. Raj, Carol J. Romanowski, Sherif G. Aly, Brett A. Becker, Juan Chen, Sheikh K. Ghafoor, Nasser Giacaman, Steven I. Gordon, Cruz Izu, Shahram Rahimi, Michael P. Robson, Neena Thota
2019 conf
ITiCSE-WGR
Rajendra K. Raj, Allen Parrish, John Impagliazzo, Carol J. Romanowski, Sherif G. Aly, Casey C. Bennett, Karen C. Davis, Andrew D. McGettrick, Teresa Susana Mendes Pereira, Lovisa Sundin
2019 B conf
ITiCSE
Rajendra K. Raj, Allen Parrish, John Impagliazzo, Carol J. Romanowski, Sherif Aly Ahmed, Casey C. Bennett, Karen C. Davis, Andrew D. McGettrick, Teresa Susana Mendes Pereira, Lovisa Sundin
2019 conf
Critical Infrastructure Protection
Siddharth Dongre, Sumita Mishra, Carol J. Romanowski, Manan Buddhadev
2018 conf
Critical Infrastructure Protection
Asma Alnemari, Suchith Arodi, Valentina Rodriguez Sosa, Soni Pandey, Carol J. Romanowski, Rajendra K. Raj, Sumita Mishra
2017 conf
ICHI
Asma Alnemari, Carol J. Romanowski, Rajendra K. Raj
2016 conf
Critical Infrastructure Protection
Carol J. Romanowski, Rajendra K. Raj, Jennifer Schneider, Sumita Mishra, Bernard Brooks, Jessica Pardee, Bharat Bhole, Nikolaus Robalino
2016 C conf
FIE
Sumita Mishra, Trudy Howles, Rajendra K. Raj, Carol J. Romanowski, Jennifer Schneider, Alicia McNett, Daryl J. Dates
2015 J jnl
Int. J. Crit. Infrastructure Prot.
Carol J. Romanowski, Rajendra K. Raj, Jennifer Schneider, Sumita Mishra, Vinay Shivshankar, Srikant Ayengar, Fernando Cueva
2013 C conf
FIE
Sumita Mishra, Carol J. Romanowski, Rajendra K. Raj, Trudy Howles, Jennifer Schneider
2013 C conf
FIE
Carol J. Romanowski, Rajendra K. Raj
2011 C conf
FIE
Carol J. Romanowski, Rajendra K. Raj, S. Manian Ramkumar
2011 C conf
FIE
Carol J. Romanowski, Rajendra K. Raj, Minseok Kwon
2009 conf
CSIE (4)
Priyanka Sinha, Rajendra K. Raj, Carol J. Romanowski
2009 ch.
Encyclopedia of Data Warehousing and Mining
Carol J. Romanowski
2006 J jnl
Comput. Oper. Res.
Carol J. Romanowski, Rakesh Nagi, Moises Sudit
2005 J jnl
IEEE Trans. Syst. Man Cybern. Part A
Carol J. Romanowski, Rakesh Nagi
2004 J jnl
J. Comput. Inf. Sci. Eng.
Carol J. Romanowski, Rakesh Nagi
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