Ram P. Krish

15 papers B 1C 1Journal 7Unranked 5
YearRankTypeTitle / Venue / Authors
2025 conf
ISBI
Sarang Galada, Tanurima Halder, Kunal Deo, Ram P. Krish, Kshitij S. Jadhav
2024 J jnl
CoRR
Sarang Galada, Tanurima Halder, Kunal Deo, Ram P. Krish, Kshitij S. Jadhav
2023 J jnl
Concurr. Comput. Pract. Exp.
Pratheep Kumar P, Mary Amala Bai V, Ram P. Krish
2021 J jnl
Int. J. Bio Inspired Comput.
Beshiba Wilson, Julia Punitha Malar Dhas, Ruma Madhu Sreedharan, Ram P. Krish
2019 J jnl
Inf. Fusion
Ram P. Krish, Julian Fiérrez, Daniel Ramos, Fernando Alonso-Fernandez, Josef Bigün
2018 J jnl
CoRR
Ram P. Krish, Julian Fiérrez, Daniel Ramos, Fernando Alonso-Fernandez, Josef Bigün
2017 ch.
Handbook of Biometrics for Forensic Science
Daniel Ramos, Ram P. Krish, Julian Fiérrez, Didier Meuwly
2015 conf
WIFS
Ram P. Krish, Julian Fiérrez, Daniel Ramos
2015 J jnl
IET Biom.
Ram P. Krish, Julian Fiérrez, Daniel Ramos, Javier Ortega-Garcia, Josef Bigün
2014 J jnl
IET Biom.
Marcos Martinez-Diaz, Julian Fiérrez, Ram P. Krish, Javier Galbally
2014 conf
IWBF
Ram P. Krish, Julian Fiérrez, Daniel Ramos, Javier Ortega-Garcia, Josef Bigün
2014 B conf
ICPR
Ram P. Krish, Julian Fiérrez, Daniel Ramos, Javier Ortega-Garcia, Josef Bigün
2013 conf
PAAMS (Workshops)
Ram P. Krish, Julian Fiérrez, Javier Galbally, Marcos Martinez-Diaz
2013 C conf
PSIVT
Ram P. Krish, Julian Fiérrez, Daniel Ramos, Raymond N. J. Veldhuis, Ruifang Wang
2013 conf
SIBGRAPI
Ruifang Wang, Daniel Ramos, Julian Fiérrez, Ram P. Krish
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