Isabelle Fagnot

22 papers A 2Misc 1Journal 12Unranked 6
YearRankTypeTitle / Venue / Authors
2021 ch.
Handbook of Automata Theory (I.)
Jean Berstel, Luc Boasson, Olivier Carton, Isabelle Fagnot
2018 J jnl
Int. J. Hum. Comput. Stud.
Kevin Crowston, Isabelle Fagnot
2017 conf
AMCIS
Azadeh Savoli, Shamel Addas, Isabelle Fagnot
2015 J jnl
CoRR
Luc Boasson, Paola Bonizzoni, Clelia De Felice, Isabelle Fagnot, Gabriele Fici, Rocco Zaccagnino, Rosalba Zizza
2014 conf
Discrete Mathematics and Computer Science
Luc Boasson, Paola Bonizzoni, Clelia De Felice, Isabelle Fagnot, Gabriele Fici, Rocco Zaccagnino, Rosalba Zizza
2013 conf
MICAI (2)
Alejandra Duenas, Christine Di Martinelly, Isabelle Fagnot
2012 conf
AMCIS
Frank Goethals, Shamel Addas, Isabelle Fagnot
2012 J jnl
Theor. Comput. Sci.
Jean Berstel, Luc Boasson, Isabelle Fagnot
2011 J jnl
CoRR
Jean Berstel, Luc Boasson, Isabelle Fagnot
2010 J jnl
CoRR
Jean Berstel, Luc Boasson, Olivier Carton, Isabelle Fagnot
2010 J jnl
Theory Comput. Syst.
Jean Berstel, Luc Boasson, Olivier Carton, Isabelle Fagnot
2009 J jnl
CoRR
Jean Berstel, Luc Boasson, Olivier Carton, Isabelle Fagnot
2009 Misc conf
COCOON
Isabelle Fagnot, Guillaume Fertin, Stéphane Vialette
2008 J jnl
J. Discrete Algorithms
Isabelle Fagnot, Gaëlle Lelandais, Stéphane Vialette
2007 A conf
STACS
Jean Berstel, Luc Boasson, Olivier Carton, Isabelle Fagnot
2007 conf
AMCIS
Isabelle Fagnot, Indira R. Guzman, Jeffrey M. Stanton
2006 J jnl
RAIRO Theor. Informatics Appl.
Isabelle Fagnot
2006 conf
CPR
Jeffrey M. Stanton, Indira R. Guzman, Isabelle Fagnot
2002 J jnl
Discret. Appl. Math.
Isabelle Fagnot, Laurent Vuillon
1997 J jnl
Discret. Appl. Math.
Isabelle Fagnot
1997 J jnl
Theor. Comput. Sci.
Isabelle Fagnot
1995 A conf
STACS
Isabelle Fagnot
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