Ian Graham

25 papers A 2Misc 3Journal 16Unranked 3
YearRankTypeTitle / Venue / Authors
2023 J jnl
CoRR
Zhe Wang, Petar Velickovic, Daniel Hennes, Nenad Tomasev, Laurel Prince, Michael Kaisers, Yoram Bachrach, Romuald Elie, Li Kevin Wenliang, Federico Piccinini, William Spearman, Ian Graham, Jerome T. Connor, Yi Yang, Adrià Recasens, Mina Khan, Nathalie Beauguerlange, Pablo Sprechmann, Pol Moreno, Nicolas Heess, Michael Bowling, Demis Hassabis, Karl Tuyls
2021 J jnl
J. Artif. Intell. Res.
Karl Tuyls, Shayegan Omidshafiei, Paul Muller, Zhe Wang, Jerome T. Connor, Daniel Hennes, Ian Graham, William Spearman, Tim Waskett, Dafydd Steele, Pauline Luc, Adrià Recasens, Alexandre Galashov, Gregory Thornton, Romuald Elie, Pablo Sprechmann, Pol Moreno, Kris Cao, Marta Garnelo, Praneet Dutta, Michal Valko, Nicolas Heess, Alex Bridgland, Julien Pérolat, Bart De Vylder, S. M. Ali Eslami, Mark Rowland, Andrew Jaegle, Rémi Munos, Trevor Back, Razia Ahamed, Simon Bouton, Nathalie Beauguerlange, Jackson Broshear, Thore Graepel, Demis Hassabis
2021 J jnl
CoRR
Shayegan Omidshafiei, Daniel Hennes, Marta Garnelo, Eugene Tarassov, Zhe Wang, Romuald Elie, Jerome T. Connor, Paul Muller, Ian Graham, William Spearman, Karl Tuyls
2020 J jnl
CoRR
Karl Tuyls, Shayegan Omidshafiei, Paul Muller, Zhe Wang, Jerome T. Connor, Daniel Hennes, Ian Graham, William Spearman, Tim Waskett, Dafydd Steele, Pauline Luc, Adrià Recasens, Alexandre Galashov, Gregory Thornton, Romuald Elie, Pablo Sprechmann, Pol Moreno, Kris Cao, Marta Garnelo, Praneet Dutta, Michal Valko, Nicolas Heess, Alex Bridgland, Julien Pérolat, Bart De Vylder, S. M. Ali Eslami, Mark Rowland, Andrew Jaegle, Rémi Munos, Trevor Back, Razia Ahamed, Simon Bouton, Nathalie Beauguerlange, Jackson Broshear, Thore Graepel, Demis Hassabis
2013 conf
ICC Workshops
Daniele Miorandi, Iacopo Carreras, Enrico Gregori, Ian Graham, James Stewart
2013 J jnl
Int. J. IT Stand. Stand. Res.
Xiaobai Shen, Ian Graham, James Stewart, Robin Williams
2011 J jnl
Technol. Anal. Strateg. Manag.
Robin Williams, Ian Graham, Kai Jakobs, Kalle Lyytinen
2011 conf
SIIT
Xiaobai Shen, Ian Graham, James Stewart, Robin Williams
2011 J jnl
Technol. Anal. Strateg. Manag.
James Stewart, Xiaobai Shen, Chengwei Wang, Ian Graham
2011 conf
Kaleidoscope
Ian Graham
2008 J jnl
Technol. Anal. Strateg. Manag.
Raluca Bunduchi, Ian Graham, Alison U. Smart, Robin Williams
2006 Misc conf
EuroPLoP
Ian Graham
2003 Misc conf
EuroPLoP
Ian Graham, Graham Robson
2002 Misc conf
EuroPLoP
Ian Graham
2002 J jnl
IEEE Commun. Mag.
John G. Cleary, Ian Graham, Tony McGregor, Murray Pearson, Ilze Ziedins, James Curtis, Stephen Donnelly, Jed Martens, Stele Martin
2001 A conf
Internet Measurement Workshop
Gianluca Iannaccone, Christophe Diot, Ian Graham, Nick McKeown
2001 A conf
Internet Measurement Workshop
Jörg Micheel, Stephen Donnelly, Ian Graham
1999 ch.
Behavioral Specifications of Businesses and Systems
Anthony J. H. Simons, Ian Graham
1998 J jnl
Electron. Mark.
Ian Graham
1997 J jnl
J. Strateg. Inf. Syst.
Graham Spinardi, Ian Graham, Robin Williams
1997 J jnl
Fuzzy Sets Syst.
Ian Graham
1996 J jnl
J. Inf. Technol.
Ian Graham, Graham Spinardi, Robin Williams
1996 J jnl
Fuzzy Sets Syst.
Ian Graham
1996 J jnl
Fuzzy Sets Syst.
Ian Graham
1996 J jnl
Fuzzy Sets Syst.
Ian Graham
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