Jacob Fox

170 papers A* 14A 7B 2Journal 142Unranked 3
YearRankTypeTitle / Venue / Authors
2026 J jnl
Order
Jacob Fox, Huy Tuan Pham
2026 J jnl
Comput. Geom.
David Conlon, Jacob Fox, Xiaoyu He, Dhruv Mubayi, Andrew Suk, Jacques Verstraëte
2026 J jnl
Electron. J. Comb.
Jacob Fox, Noah Kravitz, Shengtong Zhang
2026 J jnl
CoRR
Jacob Fox, Jonathan Tidor
2026 J jnl
J. Comb. Theory B
Jacob Fox, Jonathan Tidor, Shengtong Zhang
2025 J jnl
Electron. J. Comb.
Jacob Fox, Zoe M. Himwich, Nitya Mani, Yunkun Zhou
2025 J jnl
J. Comb. Theory B
Jacob Fox, János Pach, Andrew Suk
2025 A conf
GD
Jacob Fox, János Pach, Andrew Suk
2025 A* conf
SoCG
Jacob Fox, János Pach, Andrew Suk
2025 J jnl
Eur. J. Comb.
Jacob Fox, Tung Nguyen, Alex D. Scott, Paul D. Seymour
2025 J jnl
J. Graph Theory
Jacob Fox, János Pach, Andrew Suk
2025 J jnl
Comb.
Jacob Fox, Rajko Nenadov, Huy Tuan Pham
2024 A* conf
SoCG
Jacob Fox, János Pach, Andrew Suk
2024 J jnl
CoRR
Jacob Fox, Huy Tuan Pham
2024 A conf
GD
Jacob Fox, János Pach, Andrew Suk
2024 J jnl
Random Struct. Algorithms
Jacob Fox, Zoe M. Himwich, Nitya Mani
2024 J jnl
Random Struct. Algorithms
Jacob Fox, Sammy Luo, Huy Tuan Pham
2024 J jnl
CoRR
David Conlon, Jacob Fox, Huy Tuan Pham, Liana Yepremyan
2024 J jnl
Eur. J. Comb.
Jacob Fox, János Pach, Andrew Suk
2024 J jnl
IEEE Trans. Inf. Theory
David Conlon, Jacob Fox, Huy Tuan Pham, Yufei Zhao
2024 J jnl
Comb. Probab. Comput.
Jacob Fox, Sammy Luo, Huy Tuan Pham, Yunkun Zhou
2023 J jnl
CoRR
Jacob Fox, János Pach, Andrew Suk
2023 J jnl
Random Struct. Algorithms
David Conlon, Jacob Fox, Xiaoyu He, Dhruv Mubayi, Andrew Suk, Jacques Verstraëte
2023 J jnl
J. Graph Theory
Jacob Fox, Zoe M. Himwich, Nitya Mani
2023 J jnl
J. Graph Theory
Jacob Fox, Yuval Wigderson
2023 J jnl
Comb. Probab. Comput.
David Conlon, Jacob Fox, Yuval Wigderson
2023 J jnl
CoRR
David Conlon, Jacob Fox, Huy Tuan Pham, Yufei Zhao
2023 J jnl
Comb.
Jacob Fox, János Pach, Andrew Suk
2023 J jnl
Comb.
David Conlon, Jacob Fox, Yuval Wigderson
2023 J jnl
Eur. J. Comb.
David Conlon, Jacob Fox, Benny Sudakov, Fan Wei
2022 J jnl
Random Struct. Algorithms
Matija Bucic, Jacob Fox, Benny Sudakov
2022 J jnl
CoRR
Jacob Fox, Zoe M. Himwich, Nitya Mani
2022 J jnl
J. Graph Theory
Jacob Fox, Xiaoyu He, Sammy Luo, Max Wenqiang Xu
2022 A conf
GD
Jacob Fox, János Pach, Andrew Suk
2022 J jnl
Comb.
David Conlon, Jacob Fox, Yuval Wigderson
2022 J jnl
Comb. Probab. Comput.
Jacob Fox, Yufei Zhao
2021 J jnl
SIAM J. Discret. Math.
Quentin Dubroff, Jacob Fox, Max Wenqiang Xu
2021 J jnl
Comb.
Jacob Fox, János Pach, Andrew Suk
2021 J jnl
CoRR
Jacob Fox, Zoe M. Himwich, Nitya Mani
2021 A conf
GD
Jacob Fox, János Pach, Andrew Suk
2021 J jnl
Random Struct. Algorithms
Jacob Fox, Lisa Sauermann, Fan Wei
2021 J jnl
CoRR
Jacob Fox, János Pach, Andrew Suk
2021 J jnl
Comb. Probab. Comput.
Nemanja Draganic, François Dross, Jacob Fox, António Girão, Frédéric Havet, Dániel Korándi, William Lochet, David Munhá Correia, Alex D. Scott, Benny Sudakov
2021 J jnl
CoRR
Jacob Fox, János Pach, Andrew Suk
2021 J jnl
Random Struct. Algorithms
Jacob Fox, Cosmin Pohoata
2021 A* conf
SoCG
Jacob Fox, János Pach, Andrew Suk
2021 J jnl
SIAM J. Discret. Math.
John Engbers, Aysel Erey, Jacob Fox, Xiaoyu He
2020 J jnl
SIAM J. Discret. Math.
David Conlon, Jacob Fox, Benny Sudakov
2020 A* conf
SoCG
Jacob Fox, János Pach, Andrew Suk
2020 J jnl
SIAM J. Comput.
Jacob Fox, Tim Roughgarden, C. Seshadhri, Fan Wei, Nicole Wein
2020 J jnl
Comb. Probab. Comput.
Jacob Fox, Ray Li
2020 J jnl
Random Struct. Algorithms
Jacob Fox, Ray Li
2020 J jnl
SIAM J. Discret. Math.
Jacob Fox, Fan Wei
2020 J jnl
J. Graph Theory
Maria Chudnovsky, Jacob Fox, Alex Scott, Paul D. Seymour, Sophie Spirkl
2020 J jnl
Random Struct. Algorithms
Jacob Fox, Xiaoyu He, Yuval Wigderson
2020 J jnl
Random Struct. Algorithms
David Conlon, Jacob Fox, Benny Sudakov
2020 J jnl
J. Comb. Theory B
Asaf Ferber, Jacob Fox, Vishesh Jain
2019 J jnl
Comb. Probab. Comput.
Jacob Fox, László Miklós Lovász, Yufei Zhao
2019 J jnl
J. Comb. Theory B
Jacob Fox, Xiaoyu He, Freddie Manners
2019 J jnl
Comput. Geom.
Jacob Fox, János Pach, Andrew Suk
2019 J jnl
Discret. Comput. Geom.
Jacob Fox, János Pach, Andrew Suk
2019 J jnl
CoRR
Jacob Fox, Jonathan Tidor, Yufei Zhao
2019 J jnl
Discret. Comput. Geom.
David Conlon, Jacob Fox
2019 J jnl
CoRR
Jacob Fox, Ray Li
2019 A* conf
SoCG
Jacob Fox, János Pach, Andrew Suk
2019 J jnl
J. Comb. Theory B
Jacob Fox, Lior Gishboliner, Asaf Shapira, Raphael Yuster
2019 J jnl
Comb.
Maria Chudnovsky, Jacob Fox, Alex D. Scott, Paul D. Seymour, Sophie Spirkl
2018 J jnl
CoRR
Jacob Fox, Lisa Sauermann
2018 J jnl
CoRR
Jacob Fox, László Miklós Lovász, Yufei Zhao
2018 J jnl
J. Comb. Theory A
Jacob Fox, László Miklós Lovász, Lisa Sauermann
2018 J jnl
Electron. J. Comb.
Jacob Fox, Lisa Sauermann
2018 J jnl
Comb. Probab. Comput.
Jacob Fox, László Miklós Lovász, Yufei Zhao
2018 J jnl
Comb. Probab. Comput.
Jacob Fox, Fan Wei
2018 A* conf
ICALP
Jacob Fox, Tim Roughgarden, C. Seshadhri, Fan Wei, Nicole Wein
2018 J jnl
CoRR
Jacob Fox, Tim Roughgarden, C. Seshadhri, Fan Wei, Nicole Wein
2018 J jnl
Comb.
Jacob Fox, János Pach, Andrew Suk
2018 J jnl
Electron. J. Comb.
Jacob Fox, János Pach, Andrew Suk
2018 J jnl
CoRR
Asaf Ferber, Jacob Fox, Vishesh Jain
2017 A* conf
SODA
Jacob Fox, László Miklós Lovász
2017 J jnl
Comb.
Jacob Fox, László Miklós Lovász
2017 A* conf
SoCG
Jacob Fox, János Pach, Andrew Suk
2017 J jnl
Comb. Probab. Comput.
Jacob Fox, László Miklós Lovász, Yufei Zhao
2017 J jnl
Electron. Notes Discret. Math.
Jacob Fox, Fan Wei
2017 J jnl
J. Comb. Theory B
Jacob Fox, Fan Wei
2017 J jnl
J. Comb. Theory B
David Conlon, Jacob Fox, Choongbum Lee, Benny Sudakov
2017 A* conf
SODA
Jacob Fox, Fan Wei
2016 J jnl
SIAM J. Comput.
Jacob Fox, János Pach, Andrew Suk
2016 A conf
GD
Jacob Fox, János Pach, Andrew Suk
2016 J jnl
CoRR
Jacob Fox, János Pach, Andrew Suk
2016 A* conf
SoCG
Jacob Fox
2016 J jnl
CoRR
Jacob Fox, Fan Wei
2016 J jnl
J. Comb. Theory B
Jacob Fox, Andrey Grinshpun, Anita Liebenau, Yury Person, Tibor Szabó
2016 J jnl
CoRR
Jacob Fox, Fan Wei
2016 J jnl
Comb.
David Conlon, Jacob Fox, Choongbum Lee, Benny Sudakov
2016 J jnl
J. Comb. Theory B
David Conlon, Jacob Fox, Benny Sudakov
2015 J jnl
CoRR
Jacob Fox, János Pach, Andrew Suk
2015 A* conf
SODA
Jacob Fox, János Pach, Andrew Suk
2015 J jnl
SIAM J. Discret. Math.
David Conlon, Jacob Fox, William I. Gasarch, David G. Harris, Douglas Ulrich, Samuel Zbarsky
2015 J jnl
Comb. Probab. Comput.
Noga Alon, Jacob Fox
2015 ch.
Surveys in Combinatorics
David Conlon, Jacob Fox, Benny Sudakov
2015 J jnl
CoRR
Jacob Fox, János Pach, Andrew Suk
2015 J jnl
J. Comb. Theory B
Jacob Fox, Andrey Grinshpun, János Pach
2015 J jnl
Comb.
Jacob Fox, Po-Shen Loh, Yufei Zhao
2014 J jnl
Comb.
Matt DeVos, Zdenek Dvorák, Jacob Fox, Jessica McDonald, Bojan Mohar, Diego Scheide
2014 J jnl
CoRR
Jacob Fox, László Miklós Lovász
2014 J jnl
Comb. Probab. Comput.
Jacob Fox, János Pach
2014 J jnl
Random Struct. Algorithms
David Conlon, Jacob Fox, Benny Sudakov
2014 J jnl
CoRR
David Conlon, Jacob Fox, William I. Gasarch, David G. Harris, Douglas Ulrich, Sam Zbarsky
2014 J jnl
Comput. Geom.
Eyal Ackerman, Jacob Fox, János Pach, Andrew Suk
2014 J jnl
Comb. Probab. Comput.
David Conlon, Jacob Fox, Benny Sudakov
2014 J jnl
J. Comb. Theory B
Jacob Fox, Andrey Grinshpun, Anita Liebenau, Yury Person, Tibor Szabó
2013 J jnl
Discret. Math.
Eyal Ackerman, Jacob Fox, Rom Pinchasi
2013 J jnl
Discret. Appl. Math.
David Conlon, Jacob Fox, Benny Sudakov
2013 J jnl
CoRR
Jacob Fox, János Pach
2013 J jnl
Comb.
Jacob Fox, Choongbum Lee, Benny Sudakov
2013 ch.
Surveys in Combinatorics
David Conlon, Jacob Fox
2013 A* conf
SoCG
David Conlon, Jacob Fox, János Pach, Benny Sudakov, Andrew Suk
2013 J jnl
CoRR
Jacob Fox
2013 J jnl
SIAM J. Discret. Math.
Jacob Fox, János Pach, Andrew Suk
2013 J jnl
J. Comb. Theory B
Eli Berger, Krzysztof Choromanski, Maria Chudnovsky, Jacob Fox, Martin Loebl, Alex Scott, Paul D. Seymour, Stéphan Thomassé
2012 J jnl
Eur. J. Comb.
Jacob Fox, János Pach
2012 J jnl
J. Comb. Theory B
David Conlon, Jacob Fox, Benny Sudakov
2012 J jnl
CoRR
David Conlon, Jacob Fox, Yufei Zhao
2012 J jnl
CoRR
David Conlon, Jacob Fox
2012 J jnl
Comb.
Jacob Fox, Po-Shen Loh
2012 J jnl
Comb.
David Conlon, Jacob Fox, Benny Sudakov
2012 conf
SCG
Jacob Fox, János Pach
2011 J jnl
CoRR
David Conlon, Jacob Fox
2011 A* conf
SODA
Jacob Fox, János Pach
2011 J jnl
CoRR
Jacob Fox
2011 J jnl
Random Struct. Algorithms
Jacob Fox, Benny Sudakov
2011 J jnl
CoRR
David Conlon, Jacob Fox, Benny Sudakov
2011 J jnl
J. Lond. Math. Soc.
Jacob Fox, János Pach, Csaba D. Tóth
2011 A* conf
SODA
Jacob Fox, Mikhail Gromov, Vincent Lafforgue, Assaf Naor, János Pach
2011 J jnl
CoRR
Noga Alon, Jacob Fox
2011 J jnl
CoRR
Jacob Fox, János Pach, Andrew Suk
2011 J jnl
CoRR
David Conlon, Jacob Fox, Benny Sudakov
2010 J jnl
Comb. Probab. Comput.
Jacob Fox, János Pach
2010 J jnl
J. Comb. Theory B
Jacob Fox, János Pach, Csaba D. Tóth
2010 J jnl
CoRR
Jacob Fox
2010 J jnl
SIAM J. Discret. Math.
Jacob Fox
2010 B conf
WALCOM
Jacob Fox, Fabrizio Frati, János Pach, Rom Pinchasi
2010 J jnl
Comb. Probab. Comput.
Jacob Fox, Benny Sudakov
2010 J jnl
Comb. Probab. Comput.
Jacob Fox, Peter Keevash, Benny Sudakov
2010 J jnl
CoRR
Jacob Fox, Choongbum Lee, Benny Sudakov
2010 J jnl
CoRR
Jacob Fox, Mikhail Gromov, Vincent Lafforgue, Assaf Naor, János Pach
2009 B conf
WALCOM
Jacob Fox, János Pach
2009 J jnl
Eur. J. Comb.
Jacob Fox, János Pach
2009 J jnl
Electron. J. Comb.
Michael O. Albertson, Daniel W. Cranston, Jacob Fox
2009 J jnl
Comb.
Jacob Fox, Benny Sudakov
2009 J jnl
J. Comb. Theory B
Jacob Fox, Po-Shen Loh, Benny Sudakov
2009 conf
SCG
Eyal Ackerman, Jacob Fox, János Pach, Andrew Suk
2009 J jnl
Electron. J. Comb.
Jacob Fox, Benny Sudakov
2009 J jnl
Random Struct. Algorithms
David Conlon, Jacob Fox, Benny Sudakov
2009 J jnl
Eur. J. Comb.
Jacob Fox, Benny Sudakov
2008 conf
SCG
Jacob Fox, János Pach
2008 J jnl
J. Comb. Theory B
Jacob Fox, Benny Sudakov
2008 J jnl
J. Comb. Theory B
Jacob Fox, Csaba D. Tóth
2008 J jnl
Discret. Math.
Jacob Fox, Mohammad Mahdian, Rados Radoicic
2008 J jnl
SIAM J. Discret. Math.
Jacob Fox, Benny Sudakov
2008 J jnl
J. Graph Theory
Jacob Fox
2008 J jnl
J. Comb. Theory A
Jacob Fox, Benny Sudakov
2007 A conf
GD
Jacob Fox, János Pach, Csaba D. Tóth
2007 J jnl
J. Comb. Theory A
Jacob Fox
2007 J jnl
Electron. Notes Discret. Math.
Jacob Fox, Benny Sudakov
2007 J jnl
Electron. Notes Discret. Math.
Jacob Fox, Veselin Jungic, Rados Radoicic
2007 J jnl
J. Graph Theory
Jacob Fox, Kathy Lin
2006 J jnl
Order
Jacob Fox
2006 J jnl
J. Comb. Theory A
Jacob Fox, Daniel J. Kleitman
2006 A conf
GD
Jacob Fox, Csaba D. Tóth
tests/integration/test_elf_extractors.py
← Index tests/integration/test_elf_extractors.py python
"""
Integration tests for ELF-specific extractors.
"""
import pytest
from unittest.mock import Mock, patch, MagicMock

pytestmark = [pytest.mark.integration, pytest.mark.elf]


# ============================================================================
# ELFFeaturesExtractor Tests
# ============================================================================

class TestELFFeaturesExtractor:
    """Tests for ELFFeaturesExtractor class."""

    def test_extract_valid_elf(self, elf_binary_path, mock_logger):
        """Test extracting features from valid ELF file."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor
        from redb.models.dataclasses import ELFFeatures

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            assert result is not None
            assert isinstance(result, ELFFeatures)

    def test_extract_header_data(self, elf_binary_path, mock_logger):
        """Test ELF header data extraction."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            assert result is not None
            # Check header fields
            assert isinstance(result.ei_class, int)
            assert isinstance(result.ei_data, int)
            assert isinstance(result.e_type, int)
            assert isinstance(result.e_machine, int)
            assert isinstance(result.e_entry, int)

    def test_extract_human_readable_strings(self, elf_binary_path, mock_logger):
        """Test human-readable string fields."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            assert result is not None
            assert result.ei_class_str in ['32-bit', '64-bit', 'unknown']
            assert result.ei_data_str in ['Little-endian', 'Big-endian', 'unknown']
            assert result.e_type_str is not None
            assert result.e_machine_str is not None

    def test_extract_security_properties(self, elf_binary_path, mock_logger):
        """Test security property extraction."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            assert result is not None
            # Security flags should be 0 or 1
            assert result.is_pie in [0, 1]
            assert result.has_canary in [0, 1]
            assert result.has_nx in [0, 1]
            assert result.has_relro in [0, 1]
            assert result.has_fortify in [0, 1]

    def test_extract_counts(self, elf_binary_path, mock_logger):
        """Test section/segment/symbol counts."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            assert result is not None
            assert result.number_of_segments >= 0
            assert result.number_of_sections >= 0
            assert result.number_of_symbols >= 0
            assert result.number_of_dynamic_symbols >= 0
            assert result.number_of_relocations >= 0
            assert result.number_of_dependencies >= 0

    def test_extract_build_info(self, elf_binary_path, mock_logger):
        """Test build information extraction."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            assert result is not None
            # Build ID may or may not be present
            if result.build_id is not None:
                assert isinstance(result.build_id, str)
            assert result.gnu_hash_present in [0, 1]
            assert result.has_debug_info in [0, 1]

    def test_extract_invalid_elf(self, pe_binary_path, mock_logger):
        """Test extraction with non-ELF file."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(pe_binary_path, mock_logger)

            result = extractor.extract()

            # Should return None for invalid ELF
            assert result is None


# ============================================================================
# ELFSectionExtractor Tests
# ============================================================================

class TestELFSectionExtractor:
    """Tests for ELFSectionExtractor class."""

    def test_extract_sections(self, elf_binary_path, mock_logger):
        """Test section extraction."""
        from redb.extractors.elf_extractors.elf_sections import ELFSectionExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFSectionExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            assert result is not None
            assert isinstance(result, list)
            assert len(result) > 0

    def test_section_properties(self, elf_binary_path, mock_logger):
        """Test section property extraction."""
        from redb.extractors.elf_extractors.elf_sections import ELFSectionExtractor
        from redb.models.dataclasses import ELFSection

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFSectionExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            if result is not None and len(result) > 0:
                section = result[0]
                assert isinstance(section, ELFSection)
                assert section.section_name is not None
                assert isinstance(section.section_type, int)
                assert isinstance(section.section_flags, int)
                assert section.section_entropy >= 0

    def test_section_hashes(self, elf_binary_path, mock_logger):
        """Test section hash computation."""
        from redb.extractors.elf_extractors.elf_sections import ELFSectionExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFSectionExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            if result is not None and len(result) > 0:
                for section in result:
                    if section.section_sha256:
                        assert len(section.section_sha256) == 64
                    if section.section_md5:
                        assert len(section.section_md5) == 32


# ============================================================================
# ELFSegmentExtractor Tests
# ============================================================================

class TestELFSegmentExtractor:
    """Tests for ELFSegmentExtractor class."""

    def test_extract_segments(self, elf_binary_path, mock_logger):
        """Test segment extraction."""
        from redb.extractors.elf_extractors.elf_segments import ELFSegmentExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFSegmentExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            assert result is not None
            assert isinstance(result, list)

    def test_segment_properties(self, elf_binary_path, mock_logger):
        """Test segment property extraction."""
        from redb.extractors.elf_extractors.elf_segments import ELFSegmentExtractor
        from redb.models.dataclasses import ELFSegment

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFSegmentExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            if result is not None and len(result) > 0:
                segment = result[0]
                assert isinstance(segment, ELFSegment)
                assert isinstance(segment.segment_type, int)
                assert isinstance(segment.segment_flags, int)


# ============================================================================
# ELFSymbolExtractor Tests
# ============================================================================

class TestELFSymbolExtractor:
    """Tests for ELFSymbolExtractor class."""

    def test_extract_symbols(self, elf_binary_path, mock_logger):
        """Test symbol extraction."""
        from redb.extractors.elf_extractors.elf_symbols import ELFSymbolExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFSymbolExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            # May be None if stripped
            if result is not None:
                assert isinstance(result, list)

    def test_symbol_properties(self, elf_binary_path, mock_logger):
        """Test symbol property extraction."""
        from redb.extractors.elf_extractors.elf_symbols import ELFSymbolExtractor
        from redb.models.dataclasses import ELFSymbol

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFSymbolExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            if result is not None and len(result) > 0:
                symbol = result[0]
                assert isinstance(symbol, ELFSymbol)
                assert symbol.symbol_name is not None
                assert isinstance(symbol.symbol_type, int)
                assert isinstance(symbol.symbol_bind, int)


# ============================================================================
# ELFImportExtractor Tests
# ============================================================================

class TestELFImportExtractor:
    """Tests for ELFImportExtractor class."""

    def test_extract_imports(self, elf_binary_path, mock_logger):
        """Test import extraction."""
        from redb.extractors.elf_extractors.elf_imports import ELFImportExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFImportExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            # May be None if no imports
            if result is not None:
                assert hasattr(result, 'elf_imports_total')

    def test_import_functions(self, elf_binary_path, mock_logger):
        """Test import function extraction."""
        from redb.extractors.elf_extractors.elf_imports import ELFImportExtractor
        from redb.models.dataclasses import ELFImport

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFImportExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            if result is not None:
                assert isinstance(result, ELFImport)
                assert isinstance(result.elf_imports_total, int)


# ============================================================================
# ELFExportExtractor Tests
# ============================================================================

class TestELFExportExtractor:
    """Tests for ELFExportExtractor class."""

    def test_extract_exports(self, elf_binary_path, mock_logger):
        """Test export extraction."""
        from redb.extractors.elf_extractors.elf_exports import ELFExportExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFExportExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            # May be None if no exports
            if result is not None:
                assert hasattr(result, 'elf_exports_total')

    def test_export_functions(self, elf_binary_path, mock_logger):
        """Test export function extraction."""
        from redb.extractors.elf_extractors.elf_exports import ELFExportExtractor
        from redb.models.dataclasses import ELFExport

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFExportExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            if result is not None:
                assert isinstance(result, ELFExport)


# ============================================================================
# ELFDependencyExtractor Tests
# ============================================================================

class TestELFDependencyExtractor:
    """Tests for ELFDependencyExtractor class."""

    def test_extract_dependencies(self, elf_binary_path, mock_logger):
        """Test dependency extraction."""
        from redb.extractors.elf_extractors.elf_dependencies import ELFDependencyExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFDependencyExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            # May be None if no dependencies
            if result is not None:
                assert isinstance(result, list)

    def test_dependency_properties(self, elf_binary_path, mock_logger):
        """Test dependency property extraction."""
        from redb.extractors.elf_extractors.elf_dependencies import ELFDependencyExtractor
        from redb.models.dataclasses import ELFDependency

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFDependencyExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            if result is not None and len(result) > 0:
                dep = result[0]
                assert isinstance(dep, ELFDependency)
                assert dep.dependency_name is not None


# ============================================================================
# ELFRelocationExtractor Tests
# ============================================================================

class TestELFRelocationExtractor:
    """Tests for ELFRelocationExtractor class."""

    def test_extract_relocations(self, elf_binary_path, mock_logger):
        """Test relocation extraction."""
        from redb.extractors.elf_extractors.elf_relocations import ELFRelocationExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFRelocationExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            # May be None if no relocations
            if result is not None:
                assert isinstance(result, list)

    def test_relocation_properties(self, elf_binary_path, mock_logger):
        """Test relocation property extraction."""
        from redb.extractors.elf_extractors.elf_relocations import ELFRelocationExtractor
        from redb.models.dataclasses import ELFRelocation

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFRelocationExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            if result is not None and len(result) > 0:
                reloc = result[0]
                assert isinstance(reloc, ELFRelocation)
                assert isinstance(reloc.relocation_offset, int)
                assert isinstance(reloc.relocation_type, int)


# ============================================================================
# ELFNotesExtractor Tests
# ============================================================================

class TestELFNotesExtractor:
    """Tests for ELFNotesExtractor class."""

    def test_extract_notes(self, elf_binary_path, mock_logger):
        """Test notes extraction."""
        from redb.extractors.elf_extractors.elf_notes import ELFNotesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFNotesExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            # May be None if no notes
            if result is not None:
                assert isinstance(result, list)

    def test_note_properties(self, elf_binary_path, mock_logger):
        """Test note property extraction."""
        from redb.extractors.elf_extractors.elf_notes import ELFNotesExtractor
        from redb.models.dataclasses import ELFNote

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFNotesExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()

            if result is not None and len(result) > 0:
                note = result[0]
                assert isinstance(note, ELFNote)
                assert note.note_name is not None
                assert isinstance(note.note_type, int)


# ============================================================================
# Integration Tests
# ============================================================================

class TestELFExtractorIntegration:
    """Integration tests for ELF extractors."""

    def test_all_extractors_valid_elf(self, elf_binary_path, mock_logger):
        """Test all ELF extractors with valid ELF file."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor
        from redb.extractors.elf_extractors.elf_sections import ELFSectionExtractor
        from redb.extractors.elf_extractors.elf_segments import ELFSegmentExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            features_ext = ELFFeaturesExtractor(elf_binary_path, mock_logger)
            sections_ext = ELFSectionExtractor(elf_binary_path, mock_logger)
            segments_ext = ELFSegmentExtractor(elf_binary_path, mock_logger)

            features_result = features_ext.extract()
            sections_result = sections_ext.extract()
            segments_result = segments_ext.extract()

            # All should extract something
            assert features_result is not None
            assert sections_result is not None
            assert segments_result is not None

    def test_hash_consistency_across_extractors(self, elf_binary_path, mock_logger):
        """Test that hashes are consistent across all extractors."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor
        from redb.extractors.elf_extractors.elf_sections import ELFSectionExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            features_ext = ELFFeaturesExtractor(elf_binary_path, mock_logger)
            sections_ext = ELFSectionExtractor(elf_binary_path, mock_logger)

            # Hashes should be the same
            assert features_ext.sha256 == sections_ext.sha256
            assert features_ext.md5 == sections_ext.md5
            assert features_ext.sha1 == sections_ext.sha1

    def test_clickhouse_tables_unique(self, elf_binary_path, mock_logger):
        """Test that each extractor has a unique ClickHouse table."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor
        from redb.extractors.elf_extractors.elf_sections import ELFSectionExtractor
        from redb.extractors.elf_extractors.elf_segments import ELFSegmentExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            features_ext = ELFFeaturesExtractor(elf_binary_path, mock_logger)
            sections_ext = ELFSectionExtractor(elf_binary_path, mock_logger)
            segments_ext = ELFSegmentExtractor(elf_binary_path, mock_logger)

            tables = {
                features_ext.get_clickhouse_table(),
                sections_ext.get_clickhouse_table(),
                segments_ext.get_clickhouse_table(),
            }

            # All tables should be unique
            assert len(tables) == 3


# ============================================================================
# Advanced Binary Tests
# ============================================================================

class TestELFAdvancedBinary:
    """Tests using the hello_advanced binary."""

    def test_advanced_features_extraction(self, elf_advanced_binary_path, mock_logger):
        """Test feature extraction from advanced ELF binary."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_advanced_binary_path, mock_logger)

            result = extractor.extract()

            assert result is not None
            assert result.number_of_sections > 0

    def test_advanced_sections_extraction(self, elf_advanced_binary_path, mock_logger):
        """Test section extraction from advanced ELF binary."""
        from redb.extractors.elf_extractors.elf_sections import ELFSectionExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFSectionExtractor(elf_advanced_binary_path, mock_logger)

            result = extractor.extract()

            assert result is not None
            assert len(result) > 0

            # Check for common ELF sections
            section_names = [s.section_name for s in result]
            # Most ELF files have .text section
            assert any('.text' in name for name in section_names)

    def test_advanced_segments_extraction(self, elf_advanced_binary_path, mock_logger):
        """Test segment extraction from advanced ELF binary."""
        from redb.extractors.elf_extractors.elf_segments import ELFSegmentExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFSegmentExtractor(elf_advanced_binary_path, mock_logger)

            result = extractor.extract()

            assert result is not None
            assert len(result) > 0


# ============================================================================
# Export Data Tests
# ============================================================================

class TestELFExtractorExportData:
    """Tests for export data preparation."""

    def test_features_prepare_export_clickhouse(self, elf_binary_path, mock_logger):
        """Test ClickHouse export preparation for features."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)
            extractor.extract()

            result = extractor.prepare_export_data("ClickHouseExporter")

            assert result is not None
            data, column_names, column_type_names = result

            assert 'sha256' in column_names
            assert 'ei_class' in column_names
            assert 'e_machine' in column_names
            assert 'is_pie' in column_names

    def test_sections_prepare_export_clickhouse(self, elf_binary_path, mock_logger):
        """Test ClickHouse export preparation for sections."""
        from redb.extractors.elf_extractors.elf_sections import ELFSectionExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFSectionExtractor(elf_binary_path, mock_logger)
            extractor.extract()

            result = extractor.prepare_export_data("ClickHouseExporter")

            if result is not None:
                data, column_names, column_type_names = result
                assert 'section_name' in column_names
                assert 'section_entropy' in column_names

    def test_segments_prepare_export_clickhouse(self, elf_binary_path, mock_logger):
        """Test ClickHouse export preparation for segments."""
        from redb.extractors.elf_extractors.elf_segments import ELFSegmentExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFSegmentExtractor(elf_binary_path, mock_logger)
            extractor.extract()

            result = extractor.prepare_export_data("ClickHouseExporter")

            if result is not None:
                data, column_names, column_type_names = result
                assert 'segment_type' in column_names