Nan Zheng

143 papers A* 3A 5B 3C 2Misc 3Journal 100Unranked 27
YearRankTypeTitle / Venue / Authors
2026 J jnl
Comput. Methods Programs Biomed.
Wuxiang Shi, Yurong Li, Naiqing Cai, Rukai Chen, Nan Zheng, Jiyu Tan, Xuan Zhang
2026 J jnl
Adv. Eng. Informatics
Hao Lyu, Yanyong Guo, Pan Liu, Nan Zheng, Ting Wang, Quansheng Yue
2026 J jnl
J. Sci. Comput.
Nan Zheng, Xu Guo, Wenlong Pei, Wenju Zhao
2026 J jnl
J. Comput. Phys.
Xiaoli Li, Jie Shen, Nan Zheng
2026 J jnl
CoRR
Zijie Yan, Hongxiao Bai, Xin Yao, Dennis Liu, Tong Liu, Hongbin Liu, Pingtian Li, Evan Wu, Shiqing Fan, Li Tao, Robin Zhang, Yuzhong Wang, Shifang Xu, Jack Chang, Xuwen Chen, Kunlun Li, Yan Bai, Gao Deng, Nan Zheng, Vijay Anand Korthikanti, Abhinav Khattar, Ethan He, Soham Govande, Sangkug Lym, Zhongbo Zhu, Qi Zhang, Haochen Yuan, Xiaowei Ren, Deyu Fu, Tailai Ma, Shunkang Zhang, Jiang Shao, Ray Wang, Vasudevan Rengasamy, Rachit Garg, Santosh Bhavani, Xipeng Li, Chandler Zhou, David Wu, Yingcan Wei, Ashwath Aithal, Michael Andersch, Mohammad Shoeybi, Jiajie Yao, June Yang
2026 J jnl
Neurocomputing
Song Zhang, Nan Zheng, Liang Zhang, Xuemei Jiang, Yifeng Jin
2025 J jnl
CoRR
Nan Zheng, Qingguang Guan, Wenlong Pei, Wenju Zhao
2025 J jnl
Comput. Methods Programs Biomed.
Wuxiang Shi, Yurong Li, Nan Zheng, Wenyao Hong, Zhenhua Zhao, Wensheng Chen, Xiaojing Xue, Ting Chen
2025 J jnl
CoRR
Hao Lyu, Yanyong Guo, Pan Liu, Nan Zheng, Ting Wang
2025 J jnl
Int. J. Hum. Comput. Interact.
Zheng Xu, Tanghan Jiang, Dong Xiao, Yihai Fang, Nan Zheng
2025 conf
ITSC
Zheng Xu, Dong Xiao, Nan Zheng
2025 J jnl
J. King Saud Univ. Comput. Inf. Sci.
Maomao Sun, Ting Rui, Jianqing Liu, Dong Wang, Chengsong Yang, Nan Zheng
2025 J jnl
Neurocomputing
Liang Zhang, Nan Zheng
2025 J jnl
Artif. Intell. Medicine
Nan Zheng, Yurong Li, Wuxiang Shi, Jiyu Tan
2025 J jnl
IEEE J. Biomed. Health Informatics
Wensheng Chen, Yurong Li, Nan Zheng, Wuxiang Shi
2025 J jnl
CoRR
Nan Zheng, Xu Guo, Wenlong Pei, Wenju Zhao
2025 J jnl
Comput. Aided Geom. Des.
Nan Zheng, Xiaoya Zhai, Falai Chen
2025 J jnl
IEEE Trans. Intell. Veh.
Min Zhou, Hairong Dong, Haifeng Song, Nan Zheng, Wen-Hua Chen, Hongwei Wang
2025 J jnl
SIAM J. Numer. Anal.
Dianming Hou, Xiaoli Li, Zhonghua Qiao, Nan Zheng
2025 J jnl
CoRR
Leizhen Wang, Peibo Duan, Hao Wang, Yue Wang, Jian Xu, Nan Zheng, Zhenliang Ma
2025 J jnl
NeuroImage
Haoxin Cui, Yujing Liang, Fankai Sun, Desheng Li, Xiangqing Wang, Rong Wang, Nan Zheng
2025 J jnl
IEEE Trans. Intell. Veh.
Changshuai Wang, Weilin Ren, Chengcheng Xu, Nan Zheng, Chang Peng, Hao Tong
2025 J jnl
IEEE J. Sel. Top. Appl. Earth Obs. Remote. Sens.
Ziyi Wan, Enyuan Zhao, Jie Nie, Ze Zhang, Zhiqiang Wei, Nan Zheng, Yuting Zhao
2025 J jnl
Biomed. Signal Process. Control.
Ning Gao, Yurong Li, Nan Zheng, Wuxiang Shi, Dan Cai, Xiaoying Huang, Hong Chen
2025 J jnl
Math. Comput.
Xiao Li, Zhonghua Qiao, Cheng Wang, Nan Zheng
2025 J jnl
CoRR
Zhengguang Liu, Nan Zheng, Xiaoli Li
2025 J jnl
IEEE Trans. Instrum. Meas.
Yurong Li, Xiaofeng Lin, Qiang Liu, Nan Zheng, Jiyu Tan, Miaoqin Zhan
2025 J jnl
J. Sci. Comput.
Xiaoli Li, Zhengguang Liu, Jie Shen, Nan Zheng
2025 J jnl
IEEE CAA J. Autom. Sinica
Qinghua Ni, Viktória Buday, Fei Lin, Jun Huang, Levente Kovács, Nan Zheng, Fei-Yue Wang
2025 J jnl
CoRR
Ziyi Huang, Yang Li, Dushuai Li, Yao Mu, Hongmao Qin, Nan Zheng
2025 J jnl
Frontiers Comput. Sci.
Song Zhang, Lei He, Dong Wang, Hongyun Bao, Suncong Zheng, Yuqiao Liu, Baihua Xiao, Jiayue Li, Dongyuan Lu, Nan Zheng
2025 J jnl
Comput. Aided Civ. Infrastructure Eng.
Linxin Hua, Lirui Guo, Nan Zheng, Ye Lu, Jia Xu, Jianghua Deng
2025 J jnl
Neurocomputing
Yuqiao Liu, Nan Zheng, Song Zhang, Jiayue Li, Dongyuan Lu
2025 conf
ITSC
Leizhen Wang, Peibo Duan, Cheng Lyu, Zewen Wang, Nan Zheng, Zhenliang Ma
2025 J jnl
CoRR
Leizhen Wang, Peibo Duan, Cheng Lyu, Zewen Wang, Zhiqiang He, Nan Zheng, Zhenliang Ma
2025 J jnl
J. Sci. Comput.
Xiaoli Li, Hao Liu, Nan Zheng
2025 J jnl
Knowl. Based Syst.
Wensheng Chen, Cong Yu, Zhenhua Zhao, Nan Zheng, Han Li, Yurong Li
2025 J jnl
Neurocomputing
Nan Zheng, Yurong Li, Wuxiang Shi, Qiurong Xie
2025 J jnl
Commun. Nonlinear Sci. Numer. Simul.
Nan Zheng, Jie Shen
2025 J jnl
IEEE Trans. Intell. Veh.
Wei Zhou, Nan Zheng, Chen Wang
2025 J jnl
IEEE Intell. Transp. Syst. Mag.
Jing Yang, Xingyuan Dai, Nan Zheng, Peijun Ye, Yisheng Lv, Fei-Yue Wang
2025 J jnl
CoRR
Nan Zheng, Wenlong Pei, Qingguang Guan, Wenju Zhao
2024 conf
ANZCC
Haoxin Cui, Nan Zheng, Xiaoyu Chang
2024 J jnl
IEEE Intell. Transp. Syst. Mag.
Ruyang Yin, Pengli Mo, Nan Zheng, Qiujie Xu
2024 J jnl
Swarm Evol. Comput.
Nan Zheng, Handing Wang
2024 J jnl
CoRR
Leizhen Wang, Peibo Duan, Zhengbing He, Cheng Lyu, Xin Chen, Nan Zheng, Li Yao, Zhenliang Ma
2024 J jnl
Biomed. Signal Process. Control.
Nan Zheng, Yurong Li
2024 conf
HICSS
Chen Guo, Zifei "Sherry" Guo, Nan Zheng, Chengqi (John) Guo
2024 J jnl
Comput. Methods Programs Biomed.
Jingheng Shu, Nan Zheng, Huiyong Dai, Qi Wang, Tsung-Yuan Tsai, Zhan Liu
2024 J jnl
CoRR
Quang-Hung Luu, Thai M. Nguyen, Nan Zheng, Hai L. Vu
2024 J jnl
Intell. Serv. Robotics
Jian Song, Yutian Chen, Xun Liu, Nan Zheng
2024 J jnl
J. Comput. Phys.
Xinyu Liu, Jie Shen, Nan Zheng
2024 A conf
RecSys
Shijie Liu, Nan Zheng, Hui Kang, Xavier Simmons, Junjie Zhang, Matthias Langer, Wenjing Zhu, Minseok Lee, Zehuan Wang
2024 J jnl
Swarm Evol. Comput.
Nan Zheng, Handing Wang, Jialin Liu
2024 J jnl
CoRR
Xiao Li, Zhonghua Qiao, Cheng Wang, Nan Zheng
2024 conf
ICPR (19)
Liang Zhang, Nan Zheng
2024 J jnl
CoRR
Xiaoli Li, Nan Zheng, Jie Shen
2024 conf
ANZCC
Fankai Sun, Nan Zheng, Liang Zhang
2024 J jnl
IEEE Trans. Instrum. Meas.
Nan Zheng, Yurong Li
2024 J jnl
IEEE CAA J. Autom. Sinica
Fei Lin, Qinghua Ni, Jing Yang, Juanjuan Li, Nan Zheng, Levente Kovács, Radu Prodan, Mariagrazia Dotoli, Qing-Long Han, Fei-Yue Wang
2024 J jnl
Comput. Aided Des.
Nan Zheng, Xiaoya Zhai, Jingchao Jiang, Falai Chen
2023 J jnl
Numer. Algorithms
Zhengguang Liu, Nan Zheng, Zhaojie Zhou
2023 J jnl
Swarm Evol. Comput.
Nan Zheng, Handing Wang
2023 conf
ITSC
Yunping Huang, Nan Zheng, Enming Liang, Shu-Chien Hsu, Renxin Zhong
2023 J jnl
CoRR
Zhengguang Liu, Nan Zheng, Xiaoli Li
2023 J jnl
Biomed. Signal Process. Control.
Nan Zheng, Guoying Zhang, Yang Zhang, Fatima Rashid Sheykhahmad
2023 J jnl
CoRR
Dianming Hou, Xiaoli Li, Zhonghua Qiao, Nan Zheng
2023 J jnl
CoRR
Xiaoli Li, Nan Zheng, Jie Shen, Zhengguang Liu
2023 J jnl
IEEE Intell. Syst.
Song Zhang, Nan Zheng, Danli Wang
2023 J jnl
Patterns
Hang Xu, Xianfu Yi, Xutong Fan, Chengyue Wu, Wei Wang, Xinlei Chu, Shijie Zhang, Xiaobao Dong, Zhao Wang, Jianhua Wang, Yao Zhou, Ke Zhao, Hongcheng Yao, Nan Zheng, Junwen Wang, Yupeng Chen, Dariusz Plewczynski, Pak Chung Sham, Kexin Chen, Dandan Huang, Mulin Jun Li
2023 J jnl
IEEE Intell. Transp. Syst. Mag.
Yisheng Lv, Nan Zheng
2023 J jnl
Proc. ACM Hum. Comput. Interact.
Chen Guo, Nan Zheng, Chengqi (John) Guo
2023 J jnl
Comput. Aided Des.
Nan Zheng, Xiaoya Zhai, Falai Chen
2022 J jnl
Int. J. Autom. Comput.
Song Zhang, Nan Zheng, Danli Wang
2022 J jnl
IEEE Trans. Intell. Transp. Syst.
Ruyang Yin, Zhiyuan Liu, Nan Zheng
2022 J jnl
Complex Intell. Syst.
Nan Zheng, Handing Wang, Bo Yuan
2022 A conf
CIKM
Song Zhang, Nan Zheng, Danli Wang
2022 J jnl
Appl. Math. Lett.
Nan Zheng, Xiaoli Li
2022 J jnl
J. Intell. Fuzzy Syst.
Nan Su, Zhishuo Lin, Wenlong You, Nan Zheng, Kun Ma
2022 J jnl
J. Intell. Transp. Syst.
Peng Chen, Tong Wang, Nan Zheng
2022 J jnl
IEEE Trans. Intell. Transp. Syst.
Jiali Li, Yugang Liu, Nan Zheng, Liying Tang, Hongbo Yi
2021 J jnl
Adv. Comput. Math.
Nan Zheng, Xiaoli Li
2021 J jnl
Comput. Stat. Data Anal.
Nan Zheng, Noel Cadigan
2021 J jnl
IEEE Access
Yurong Li, Wenxuan Zhang, Qian Zhang, Nan Zheng
2020 J jnl
Proc. VLDB Endow.
Nan Zheng, Zack Ives
2020 J jnl
IEEE Access
Yurong Li, Wenxin Chen, Hao Yang, Jixiang Li, Nan Zheng
2020 conf
ERVR
Yunfang Niu, Danli Wang, Ziwei Wang, Fan Sun, Kang Yue, Nan Zheng
2020 conf
SD&A
Danli Wang, Xueyu Wang, Yaguang Song, Qian Xing, Nan Zheng
2019 J jnl
Sensors
Xiaodong Guo, Fang Wen, Qinqin Qiao, Nan Zheng, Matthew Saive, Marie-Laure Fauconnier, Jiaqi Wang
2019 J jnl
IEEE Access
Wei Song, Nan Zheng, Xiangchun Liu, Lirong Qiu, Rui Zheng
2019 conf
ITSC
Ming Li, Nan Zheng, Xinkai Wu, Xiang Huo
2019 A conf
CIDR
Zack Ives, Yi Zhang, Soonbo Han, Nan Zheng
2019 J jnl
J. Inf. Hiding Multim. Signal Process.
Wei Song, Nan Zheng, Rui Zheng, Xiaobing Zhao, Antai Wang
2019 B conf
IJCNN
Yaguang Song, Danli Wang, Kang Yue, Nan Zheng, Zuo-Jun Max Shen
2019 A* conf
ICDE
Nan Zheng, Abdussalam Alawini, Zachary G. Ives
2019 J jnl
Neurocomputing
Fanxia Zeng, Wensheng Zhang, Siheng Zhang, Nan Zheng
2018 Misc conf
VLSID
Nan Zheng, Pinaki Mazumder
2018 C conf
ISCAS
Nan Zheng, Pinaki Mazumder
2018 J jnl
IEEE Trans. Circuits Syst. I Regul. Pap.
Nan Zheng, Pinaki Mazumder
2018 Misc conf
IDC
Qiao Jin, Danli Wang, Xiaozhou Deng, Nan Zheng, Steve C. Chiu
2018 conf
ITSC
Renxin Zhong, Yunping Huang, Jianhui Xiong, Nan Zheng, William H. K. Lam, Agachai Sumalee
2018 J jnl
IEEE Trans. Neural Networks Learn. Syst.
Nan Zheng, Pinaki Mazumder
2018 conf
SPML
Lian Zhou, Nan Zheng, Jian Wang, Qiancai Wei, Qinghua Zhang, Qiao Xu
2017 conf
ITSC
Takao Dantsuji, Daisuke Fukuda, Nan Zheng
2017 conf
ICC
Yue Li, Nan Zheng, Haining Wang, Kun Sun, Hui Fang
2017 J jnl
IEEE Trans. Circuits Syst. II Express Briefs
Nan Zheng, Pinaki Mazumder
2017 J jnl
IEEE Trans. Computers
Nan Zheng, Pinaki Mazumder
2017 J jnl
IEEE Trans. Circuits Syst. I Regul. Pap.
Nan Zheng, Pinaki Mazumder
2016 J jnl
ACM Trans. Inf. Syst. Secur.
Nan Zheng, Aaron Paloski, Haining Wang
2016 B conf
COLING
Wenpeng Hu, Jiajun Zhang, Nan Zheng
2015 J jnl
IEEE Trans. Syst. Man Cybern. Syst.
Nan Zheng, Shuangyong Song, Hongyun Bao
2015 J jnl
VLDB J.
Zhepeng Yan, Nan Zheng, Zachary G. Ives, Partha Pratim Talukdar, Cong Yu
2015 conf
ITSC
Javier Ortigosa, Nan Zheng, Mónica Menéndez, Nikolas Geroliminis
2015 conf
ICIMCS
Dongyuan Lu, Nan Zheng
2015 A conf
CIDR
Zachary G. Ives, Zhepeng Yan, Nan Zheng, Brian Litt, Joost B. Wagenaar
2014 C conf
ISCAS
Nan Zheng, Jaeyoung Kim, Pinaki Mazumder
2014 conf
ITSC
Nan Zheng, Guillaume Rérat, Nikolas Geroliminis
2014 J jnl
Neural Comput. Appl.
Yantao Li, Gang Zhou, Nan Zheng, Liang Hong
2014 conf
ECC
Konstantinos Ampountolas, Nan Zheng, Nikolas Geroliminis
2014 conf
ITSC
Konstantinos Ampountolas, Nan Zheng, Nikolas Geroliminis
2014 B conf
ICNP
Nan Zheng, Kun Bai, Hai Huang, Haining Wang
2013 J jnl
Proc. VLDB Endow.
Zhepeng Yan, Nan Zheng, Zachary G. Ives, Partha Pratim Talukdar, Cong Yu
2013 A conf
DSN
Jing Jin, Jeff Offutt, Nan Zheng, Feng Mao, Aaron Koehl, Haining Wang
2013 conf
ISNN (2)
Nan Zheng, Hongyun Bao
2013 conf
ITSC
Nan Zheng, Konstantinos Aboudolas, Nikolas Geroliminis
2013 Misc conf
ICNC
Nan Zheng, Xianzhong Liu
2013 J jnl
J. Cheminformatics
Gus R. Rosania, Kerby Shedden, Nan Zheng, Xinyuan Zhang
2012 J jnl
PLoS Comput. Biol.
Jing-yu Yu, Nan Zheng, Gerta Mane, Kyoung Ah Min, Juan P. Hinestroza, Huaning Zhu, Kathleen A. Stringer, Gus R. Rosania
2011 J jnl
Expert Syst. Appl.
Nan Zheng, Qiudan Li
2011 A* conf
CCS
Nan Zheng, Aaron Paloski, Haining Wang
2010 conf
AMT
Shuangyong Song, Qiudan Li, Nan Zheng
2010 A* conf
SIGIR
Nan Zheng, Qiudan Li, Shengcai Liao, Leiming Zhang
2010 conf
AMT
Shuangyong Song, Qiudan Li, Nan Zheng
2010 conf
ITSC
Nan Zheng, Andreas Hegyi, Serge P. Hoogendoorn, Henk J. van Zuylen, David Peters
2010 J jnl
J. Inf. Sci.
Nan Zheng, Qiudan Li, Shengcai Liao, Leiming Zhang
2009 conf
ICESS
Yuan Zhang, Chi-Hung Chi, Shengqing Zhang, Nan Zheng
2009 conf
MSN
Xinfeng Li, Xiaoyuan Wang, Nan Zheng, Zhiguo Wan, Ming Gu
2008 conf
AIRS
Maoqiang Xie, Jinli Liu, Nan Zheng, Dong Li, Yalou Huang, Yang Wang
2008 J jnl
J. Comput. Aided Mol. Des.
Xinyuan Zhang, Nan Zheng, Gus R. Rosania
2007 J jnl
Comput. Biol. Chem.
Yuan Zhang, Nan Zheng, Yang Zhong
2007 J jnl
Comput. Biol. Chem.
Yuan Zhang, Nan Zheng, Peng Nan, Ying Cao, Masami Hasegawa, Yang Zhong
2006 J jnl
J. Comput. Mediat. Commun.
Mark Tremayne, Nan Zheng, Jae Kook Lee, Jaekwan Jeong
2005 J jnl
Comput. Biol. Chem.
Yuan Zhang, Nan Zheng, Pei Hao, Ying Cao, Yang Zhong
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