Jacques Demongeot

135 papers A 2B 1C 8Misc 11Journal 61Unranked 50
YearRankTypeTitle / Venue / Authors
2025 J jnl
Frontiers Appl. Math. Stat.
Jacques Demongeot, Haiwe Adam Ouangko, Maryam Diarra, Leila Gofti-Laroche
2025 J jnl
Frontiers Appl. Math. Stat.
Joël Gardes, Jules Brice Tchatchueng-Mbougua, Christophe Maldivi, Mariem Jelassi, Houssem ben Khalfallah, Jacques Demongeot
2025 J jnl
CoRR
Jacques Demongeot, Eric Goles, Houssem ben Khalfallah, Marco Montalva-Medel, Sylvain Sené
2024 J jnl
Comput.
Houssem ben Khalfallah, Mariem Jelassi, Jacques Demongeot, Narjès Bellamine Ben Saoud
2024 J jnl
Frontiers Appl. Math. Stat.
Jacques Demongeot, Felix Sadyrbaev, Inna Samuilik
2024 J jnl
Inf.
Mariem Jelassi, Khouloud Matteli, Houssem ben Khalfallah, Jacques Demongeot
2023 J jnl
Frontiers Appl. Math. Stat.
Jacques Demongeot, Pierre Magal
2023 J jnl
Comput.
Jacques Demongeot, Joël Gardes, Christophe Maldivi, Denis Boisset, Kenza Boufama, Imène Touzouti
2023 J jnl
Comput. Biol. Medicine
Zhaobin Xu, Dongqing Wei, Qiangcheng Zeng, Hongmei Zhang, Yinghui Sun, Jacques Demongeot
2022 J jnl
Frontiers Appl. Math. Stat.
Antonio Glaría, Rodrigo Salas, Stéren Chabert, Pablo Roncagliolo, Alexis Arriola, Gonzalo Tapia, Matias Salinas, Herman Zepeda, Carla Taramasco, Kayode Oshinubi, Jacques Demongeot
2022 J jnl
CoRR
Jacques Demongeot, Sylvain Sené
2022 J jnl
CoRR
Jacques Demongeot, Tarek Melliti, Mathilde Noual, Damien Regnault, Sylvain Sené
2022 J jnl
Biosyst.
Jacques Demongeot, Hervé Seligmann
2022 J jnl
Math. Comput. Simul.
Jules Waku, Kayode Oshinubi, Jacques Demongeot
2022 conf
Automata and Complexity
Jacques Demongeot, Tarek Melliti, Mathilde Noual, Damien Regnault, Sylvain Sené
2022 conf
Automata and Complexity
Jacques Demongeot
2021 J jnl
Comput.
Jacques Demongeot, Kayode Oshinubi, Mustapha Rachdi, Hervé Seligmann, Florence Thuderoz, Jules Waku
2021 J jnl
Frontiers Appl. Math. Stat.
Kayode Oshinubi, Mustapha Rachdi, Jacques Demongeot
2020 J jnl
Nat. Comput.
Jacques Demongeot, Sylvain Sené
2020 conf
FSDM
Mustapha Rachdi, Ali Laksaci, Ali Hamie, Jacques Demongeot, Idir Ouassou
2020 J jnl
Biosyst.
Jacques Demongeot, Hervé Seligmann
2020 J jnl
Entropy
Mustapha Rachdi, Jules Waku, Hana Hazgui, Jacques Demongeot
2020 J jnl
J. Medical Syst.
Carla Taramasco, Yoslandy Lazo, Tomás Rodenas, Paola Fuentes, Felipe Martínez, Jacques Demongeot
2019 conf
HEALTHINF
Hajer Khlaifi, Atta Badii, Dan Istrate, Jacques Demongeot
2019 J jnl
J. Comput. Biol.
Jacques Demongeot, Hervé Seligmann
2019 conf
MedInfo
Timothée Aubourg, Jacques Demongeot, Félix Renard, Hervé Provost, Nicolas Vuillerme
2019 conf
MedInfo
Joël Gardes, Christophe Maldivi, Denis Boisset, Timothée Aubourg, Nicolas Vuillerme, Jacques Demongeot
2018 J jnl
IEEE Access
Carla Taramasco, Tomás Rodenas, Felipe Martínez, Paola Fuentes, Roberto Muñoz-Soto, Rodrigo Olivares, Victor Hugo C. de Albuquerque, Jacques Demongeot
2018 J jnl
IEEE Access
Carla Taramasco, Tomás Rodenas, Felipe Martínez, Paola Fuentes, Roberto Muñoz-Soto, Rodrigo Olivares, Victor Hugo C. de Albuquerque, Jacques Demongeot
2018 conf
SoSE
Carla Taramasco, Rodrigo Olivares, Roberto Muñoz-Soto, Tomás Rodenas, Felipe Martínez, Jacques Demongeot
2018 J jnl
Entropy
Jacques Demongeot, Mariem Jelassi, Hana Hazgui, Slimane Ben Miled, Narjès Bellamine Ben Saoud, Carla Taramasco
2018 J jnl
Adv. Appl. Math.
Jacques Demongeot, Sylvain Sené
2016 J jnl
J. Multivar. Anal.
Jacques Demongeot, Ali Hamie, Ali Laksaci, Mustapha Rachdi
2016 J jnl
Inf.
Jacques Demongeot, Adrien Elena, Mariem Jelassi, Slimane Ben Miled, Narjès Bellamine Ben Saoud, Carla Taramasco
2015 J jnl
Int. J. Bifurc. Chaos
Jacques Demongeot, Lloyd A. Demetrius
2015 C ed.
ICOST
Antoine Geissbühler, Jacques Demongeot, Mounir Mokhtari, Bessam Abdulrazak, Hamdi Aloulou
2015 C conf
ICOST
Jacques Demongeot, Adrien Elena, Carla Taramasco, Nicolas Vuillerme
2014 C conf
ICOST
Jacques Demongeot, Olivier Hansen, Ali Hamie, Hana Hazgui, Gilles Virone, Nicolas Vuillerme
2014 conf
EMBC
Xinran Li, Aline Guttmann, Jacques Demongeot, Jean-Yves Boire, Lemlih Ouchchane
2014 conf
BHI
Xinran Li, Aline Guttmann, Sébastien Cipière, Lydia Maigne, Jacques Demongeot, Jean-Yves Boire, Lemlih Ouchchane
2014 conf
WWIC
Gilles Virone, Nicolas Vuillerme, Mounir Mokhtari, Jacques Demongeot
2014 J jnl
Comput. Stat. Data Anal.
Mustapha Rachdi, Ali Laksaci, Jacques Demongeot, Abdel Abdali, Fethi Madani
2013 C conf
ICOST
Céline Franco, Bruno Diot, Anthony Fleury, Jacques Demongeot, Nicolas Vuillerme
2013 J jnl
Networks Heterog. Media
Jacques Demongeot, Mohamad Ghassani, Mustapha Rachdi, Idir Ouassou, Carla Taramasco
2013 conf
AINA Workshops
Jacques Demongeot, Ali Hamie, Antonio Glaría, Carla Taramasco
2013 J jnl
IEEE Trans. Mob. Comput.
Yannick Fouquet, Céline Franco, Bruno Diot, Jacques Demongeot, Nicolas Vuillerme
2013 conf
EMBC
Anthony Fleury, Quentin Mourcou, Celine Franco, Bruno Diot, Jacques Demongeot, Nicolas Vuillerme
2013 conf
AINA Workshops
Jacques Demongeot, Hermann Pempelfort, J. M. Martinez, Reinaldo Vallejos, Marta Barría, Carla Taramasco
2013 J jnl
Int. J. Bifurc. Chaos
Chris G. Antonopoulos, Vasileios Basios, Jacques Demongeot, Pasquale Nardone, René Thomas
2013 conf
AINA Workshops
Jacques Demongeot, Hana Hazgui, Nicolas Vuillerme
2013 conf
AINA Workshops
Jacques Demongeot, Olivier Cohen, Andrei Doncescu, Alexandra Henrion-Caude
2013 J jnl
Discret. Appl. Math.
Julio Aracena, Jacques Demongeot, Eric Fanchon, Marco Montalva
2013 J jnl
Stud. Inform. Univ.
Jacques Demongeot
2013 C conf
ICOST
Jacques Demongeot, Adrien Elena, Carla Taramasco, Nicolas Vuillerme
2013 J jnl
IEEE Trans. Biomed. Eng.
Celine Franco, Anthony Fleury, Pierre-Yves Gumery, Bruno Diot, Jacques Demongeot, Nicolas Vuillerme
2012 J jnl
Discret. Appl. Math.
Jacques Demongeot, Mathilde Noual, Sylvain Sené
2012 conf
ILP (Late Breaking Papers)
Andrei Doncescu, Katsumi Inoue, Jacques Demongeot
2012 conf
AINA Workshops
Jacques Demongeot, Olivier Hansen, Anne-Sophie Jannot, Carla Taramasco
2012 conf
AINA Workshops
Jacques Demongeot, Jules Waku
2012 J jnl
Int. J. Bifurc. Chaos
Jacques Demongeot, Jean Gaudart, Athanasios Lontos, Julie Mintsa, Emmanuel Promayon, Mustapha Rachdi
2011 conf
EMBC
Nicolas Vuillerme, P. Hlavackova, Celine Franco, Bruno Diot, Jacques Demongeot, Yohan Payan
2011 conf
EIDWT
Carla Taramasco, Jacques Demongeot
2011 conf
AINA Workshops
Nicolas Glade, Adrien Elena, Fabien Corblin, Eric Fanchon, Jacques Demongeot, Hedi Ben Amor
2011 conf
ECAL
Jacques Demongeot, Alexandra Henrion-Caude, Athanase Lontos, Emmanuel Promayon
2011 conf
AINA Workshops
Muhammad Tayyab, Athanasios Lontos, Emmanuel Promayon, Jacques Demongeot
2011 conf
AINA Workshops
Jacques Demongeot, Adrien Elena, Mathilde Noual, Sylvain Sené
2011 conf
AINA Workshops
Julie Mintsa, Mustapha Rachdi, Jacques Demongeot
2011 conf
CMSB
Jacques Demongeot, Sylvain Sené
2010 conf
AINA Workshops
Celine Franco, Jacques Demongeot, Christophe Villemazet, Nicolas Vuillerme
2010 conf
AINA Workshops
Jean Gaudart, Mohamad Ghassani, Julie Mintsa, Jules Waku, Mustapha Rachdi, Ogobara K. Doumbo, Jacques Demongeot
2010 Misc conf
CISIS
Fariba Teymoori, Olivier Hansen, Alain Franco, Jacques Demongeot
2010 conf
AINA Workshops
Flavien Caraguel, Muhammad Tayyab, Françoise Giroud, Jacques Demongeot
2010 conf
AINA Workshops
Emmanuel Faure, Carla Taramasco, Jacques Demongeot, Louise Duloquin, Benoit Lombardot, Nadine Peyriéras, Paul Bourgine
2010 conf
AINA Workshops
Antonio Glaría, Carla Taramasco, Jacques Demongeot
2010 conf
AINA Workshops
Hedi Ben Amor, Jacques Demongeot, Nicolas Glade
2010 J jnl
CoRR
Jacques Demongeot, Sylvain Sené
2010 J jnl
PLoS Comput. Biol.
Florence Thuderoz, Maria-Ana Simonet, Olivier Hansen, Nicolas Pasqual, Aurélie Dariz, Thierry-Pascal Baum, Vivien Hierle, Jacques Demongeot, Patrice-Noël Marche, Evelyne Jouvin-Marche
2010 conf
AINA Workshops
Jacques Demongeot, Mathilde Noual, Sylvain Sené
2010 Misc conf
CISIS
Celine Franco, Jacques Demongeot, Yannick Fouquet, Christophe Villemazet, Nicolas Vuillerme
2009 J jnl
Pervasive Mob. Comput.
Nicolas Vuillerme, Nicolas Pinsault, Olivier Chenu, Anthony Fleury, Yohan Payan, Jacques Demongeot
2009 J jnl
CoRR
Olivier Chenu, Nicolas Vuillerme, Jacques Demongeot, Yohan Payan
2009 Misc conf
CISIS
Fariba Teymoori, Mir Taher Mousavi, Marzieh Shirazikhah, Babak Abharilaleh, Reza Biglarian, Alain Franco, Jacques Demongeot
2009 conf
AINA Workshops
Muhammad Tayyab, Yves Usson, Thierry Léveillard, Jacques Demongeot
2009 conf
AINA Workshops
Jacques Demongeot, Eric Goles Ch., Sylvain Sené
2009 conf
AINA Workshops
Jacques Demongeot, Andrei Doncescu
2009 Misc conf
CISIS
Maria-Ana Simonet, Olivier Hansen, Florence Thuderoz, Evelyne Jouvin-Marche, Patrice-Noël Marche, Jacques Demongeot
2009 Misc conf
CISIS
Cécile Delhumeau, Jacques Demongeot, Carole Langlois, Carla Taramasco
2009 C conf
ICOST
Yannick Fouquet, Nicolas Vuillerme, Jacques Demongeot
2009 Misc conf
CISIS
Yannick Fouquet, Jacques Demongeot, Nicolas Vuillerme
2009 conf
AINA Workshops
Hedi Ben Amor, Sebastien Cadau, Adrien Elena, Daniele Dhouailly, Jacques Demongeot
2008 conf
AINA Workshops
Jacques Demongeot
2008 J jnl
Neural Networks
Jacques Demongeot, Sylvain Sené
2008 J jnl
Neural Networks
Jacques Demongeot, Christelle Jézéquel, Sylvain Sené
2008 Misc conf
CISIS
Jacques Demongeot, Norbert Noury, Nicolas Vuillerme
2008 conf
AINA Workshops
Jacques Demongeot, Michel Morvan, Sylvain Sené
2008 Misc conf
CISIS
Adrien Elena, Jacques Demongeot
2008 C conf
BIBE
Adrien Elena, Hedi Ben Amor, Nicolas Glade, Jacques Demongeot
2008 Misc conf
CISIS
Jacques Demongeot, Michel Morvan, Sylvain Sené
2008 conf
MICAI
Hedi Ben Amor, Jacques Demongeot, Sylvain Sené
2008 Misc conf
CISIS
Nicolas Vuillerme, Nicolas Pinsault, Olivier Chenu, Anthony Fleury, Yohan Payan, Jacques Demongeot
2007 conf
AINA Workshops (1)
Jacques Demongeot, Andrés Moreira
2007 J jnl
IEEE Trans. Biomed. Eng.
Fabien Robineau, Frédéric Boy, Jean Pierre Orliaguet, Jacques Demongeot, Yohan Payan
2006 J jnl
IEEE Trans. Inf. Technol. Biomed.
Gilles LeBellego, Norbert Noury, Gilles Virone, M. Mousseau, Jacques Demongeot
2006 conf
MIE
Alexandre Moreau-Gaudry, Anne Prince, Jacques Demongeot, Yohan Payan
2006 conf
VIEW
Lemlih Ouchchane, Alice Villéger, Jean-Jacques Lemaire, Jacques Demongeot, Jean-Yves Boire
2006 J jnl
BMC Bioinform.
Thierry-Pascal Baum, Vivien Hierle, Nicolas Pasqual, Fatena Bellahcene, Denys Chaume, Marie-Paule Lefranc, Evelyne Jouvin-Marche, Patrice-Noël Marche, Jacques Demongeot
2006 conf
EMBC
Nicolas Vuillerme, Olivier Chenu, Anthony Fleury, Jacques Demongeot, Yohan Payan
2006 J jnl
CoRR
Alexandre Moreau-Gaudry, Fabien Robineau, Pierre-Frédéric André, Anne Prince, Pierre Pauget, Jacques Demongeot, Yohan Payan
2004 J jnl
Theor. Comput. Sci.
Jacques Demongeot, Jacques Mazoyer
2004 J jnl
Discret. Appl. Math.
Julio Aracena, Jacques Demongeot, Eric Goles Ch.
2004 J jnl
Nucleic Acids Res.
Thierry-Pascal Baum, Nicolas Pasqual, Florence Thuderoz, Vivien Hierle, Denys Chaume, Marie-Paule Lefranc, Evelyne Jouvin-Marche, Patrice-Noël Marche, Jacques Demongeot
2004 J jnl
Theor. Comput. Sci.
Julio Aracena, Jacques Demongeot, Eric Goles Ch.
2004 J jnl
IEEE Trans. Neural Networks
Julio Aracena, Jacques Demongeot, Eric Goles Ch.
2004 J jnl
Theor. Comput. Sci.
Georges Weil, Kamel Heus, Thomas Faraut, Jacques Demongeot
2003 J jnl
IEEE Trans. Syst. Man Cybern. Part B
Julio Aracena, S. B. Lamine, Marie-Ange Mermet, Olivier Cohen, Jacques Demongeot
2002 J jnl
IEEE Trans. Biomed. Eng.
Gilles Virone, Norbert Noury, Jacques Demongeot
2002 conf
ISBI
Jacques Demongeot, F. Berger, Thierry-Pascal Baum, Florence Thuderoz, Olivier Cohen
2001 J jnl
Nucleic Acids Res.
Olivier Cohen, Marie-Ange Mermet, Jacques Demongeot
2001 B conf
Image Processing
Julian Mattes, Jacques Demongeot
2000 conf
DGCI
Julian Mattes, Jacques Demongeot
2000 C conf
BIBE
Julio Aracena, S. B. Lamine, Marie-Ange Mermet, Olivier Cohen, Jacques Demongeot
1999 A conf
MICCAI
Gelu Ionescu, Stéphane Lavallée, Jacques Demongeot
1999 J jnl
Neural Networks
Arnaud Tonnelier, Sylvain Meignen, Holger Bosch, Jacques Demongeot
1999 A conf
MICCAI
Julian Mattes, Jacques Demongeot
1999 conf
DGCI
Julian Mattes, Mathieu Richard, Jacques Demongeot
1998 J jnl
Parallel Process. Lett.
Julian Mattes, Denis Trystram, Jacques Demongeot
1995 conf
HPCN Europe
Julian Mattes, Denis Trystram, Jacques Demongeot
1993 conf
PARCO
Frédéric Berthommier, Véronique Bouchard, Lionel Brunie, Laurent Colombet, Philippe Cinquin, Jacques Demongeot, Laurent Desbat, Vincent Dessenne, Stéphane Lavallée, Jean-Louis Martiel, Olivier Nérot, L. Prilly, Emmanuel Promayon, Sandrine Rouault, Jocelyne Troccaz
1992 J jnl
Neural Networks
Olivier François, Jacques Demongeot, Thierry Hervé
1992 J jnl
Artif. Intell. Medicine
Patrice François, Bruno Crémilleux, Claudine Robert, Jacques Demongeot
1990 conf
EURASIP Workshop
Thierry Hervé, Olivier François, Jacques Demongeot
1988 J jnl
Neural Networks
Thierry Hervé, Jacques Demongeot
1987 Misc conf
ICASSP
Thierry Hervé, Jean Marc Dolmazon, Jacques Demongeot
1978 book
Jacques Demongeot
1975
Jacques Demongeot
tests/unit/test_dataclasses.py
← Index tests/unit/test_dataclasses.py python
"""
Unit tests for redb.models.dataclasses.

These tests verify construction, field defaults, and type expectations for
every dataclass in the module (excluding Mach-O dataclasses, which are
covered by test_macho_dataclasses.py).
"""
import pytest
from dataclasses import asdict, fields

pytestmark = [pytest.mark.unit, pytest.mark.dataclass]


# ============================================================================
# Hash / Hashes
# ============================================================================

class TestHashDataclass:
    """Tests for the Hash dataclass."""

    def test_creation(self):
        from redb.models.dataclasses import Hash

        h = Hash(
            md5="d41d8cd98f00b204e9800998ecf8427e",
            sha1="da39a3ee5e6b4b0d3255bfef95601890afd80709",
            sha256="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
        )
        assert h.md5 == "d41d8cd98f00b204e9800998ecf8427e"
        assert h.sha1 == "da39a3ee5e6b4b0d3255bfef95601890afd80709"
        assert h.sha256 == "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"

    def test_asdict(self):
        from redb.models.dataclasses import Hash

        h = Hash(md5="a", sha1="b", sha256="c")
        d = asdict(h)
        assert d == {"md5": "a", "sha1": "b", "sha256": "c"}


class TestHashesDataclass:
    """Tests for the Hashes dataclass."""

    def test_required_fields(self):
        from redb.models.dataclasses import Hashes

        h = Hashes(
            md5="md5val",
            sha1="sha1val",
            sha256="sha256val",
            ssdeep_hash="ssdeep",
            tlsh_hash="tlsh",
        )
        assert h.md5 == "md5val"
        assert h.ssdeep_hash == "ssdeep"

    def test_optional_pe_fields_default_none(self):
        from redb.models.dataclasses import Hashes

        h = Hashes(md5="a", sha1="b", sha256="c", ssdeep_hash="d", tlsh_hash="e")
        assert h.authentihash is None
        assert h.imphash is None
        assert h.richhash is None
        assert h.richpe_hash is None
        assert h.richpv_hash is None
        assert h.richpv_hash_sorted is None
        assert h.typerefhash is None
        assert h.impfuzzy is None

    def test_optional_elf_fields_default_none(self):
        from redb.models.dataclasses import Hashes

        h = Hashes(md5="a", sha1="b", sha256="c", ssdeep_hash="d", tlsh_hash="e")
        assert h.import_hash is None
        assert h.export_hash is None
        assert h.section_hash is None
        assert h.symbol_hash is None
        assert h.dynamic_hash is None

    def test_optional_macho_fields_default_none(self):
        from redb.models.dataclasses import Hashes

        h = Hashes(md5="a", sha1="b", sha256="c", ssdeep_hash="d", tlsh_hash="e")
        assert h.macho_dylib_hash is None
        assert h.macho_import_hash is None
        assert h.macho_export_hash is None
        assert h.macho_entitlement_hash is None
        assert h.macho_symhash is None

    def test_macho_fields_settable(self):
        from redb.models.dataclasses import Hashes

        h = Hashes(
            md5="a", sha1="b", sha256="c", ssdeep_hash="d", tlsh_hash="e",
            macho_dylib_hash="dylib_h",
            macho_import_hash="import_h",
            macho_export_hash="export_h",
            macho_entitlement_hash="ent_h",
            macho_symhash="sym_h",
        )
        assert h.macho_dylib_hash == "dylib_h"
        assert h.macho_import_hash == "import_h"
        assert h.macho_export_hash == "export_h"
        assert h.macho_entitlement_hash == "ent_h"
        assert h.macho_symhash == "sym_h"


# ============================================================================
# BasicProperties
# ============================================================================

class TestBasicPropertiesDataclass:
    """Tests for the BasicProperties dataclass."""

    def test_required_fields(self):
        from redb.models.dataclasses import BasicProperties

        bp = BasicProperties(
            filename="test.exe",
            sample_name="test.exe",
            filesize=1024,
            filetype="PE32",
            filetype_mime="application/x-dosexec",
            filetype_magika="pebin",
            file_entropy=6.5,
        )
        assert bp.filename == "test.exe"
        assert bp.filesize == 1024
        assert bp.file_entropy == 6.5

    def test_optional_fields_default_none(self):
        from redb.models.dataclasses import BasicProperties

        bp = BasicProperties(
            filename="x", sample_name="x", filesize=0,
            filetype="t", filetype_mime="m", filetype_magika="k", file_entropy=0.0,
        )
        assert bp.is_packed is None
        assert bp.is_fat is None
        assert bp.child_sha256 is None
        assert bp.child_architecture is None
        assert bp.child_filetype is None

    def test_fat_fields(self):
        from redb.models.dataclasses import BasicProperties

        bp = BasicProperties(
            filename="universal.app",
            sample_name="universal.app",
            filesize=2048,
            filetype="Mach-O universal",
            filetype_mime="application/x-mach-binary",
            filetype_magika="macho",
            file_entropy=7.2,
            is_fat=True,
            child_sha256=["hash1", "hash2"],
            child_architecture=["x86_64", "arm64"],
            child_filetype=["macho", "macho"],
        )
        assert bp.is_fat is True
        assert len(bp.child_sha256) == 2
        assert bp.child_architecture == ["x86_64", "arm64"]

    def test_asdict_roundtrip(self):
        from redb.models.dataclasses import BasicProperties

        bp = BasicProperties(
            filename="f", sample_name="s", filesize=10,
            filetype="t", filetype_mime="m", filetype_magika="k", file_entropy=1.0,
        )
        d = asdict(bp)
        assert d["filename"] == "f"
        assert d["is_fat"] is None


# ============================================================================
# DIEinfo / CAPA
# ============================================================================

class TestDIEinfoDataclass:
    def test_creation(self):
        from redb.models.dataclasses import DIEinfo

        d = DIEinfo(die_full_dump="dump_text")
        assert d.die_full_dump == "dump_text"
        assert d.die_info == {}

    def test_with_info(self):
        from redb.models.dataclasses import DIEinfo

        d = DIEinfo(die_full_dump="x", die_info={"packer": "UPX"})
        assert d.die_info["packer"] == "UPX"


class TestCAPADataclass:
    def test_creation(self):
        from redb.models.dataclasses import CAPA

        c = CAPA(
            capa_dump="dump",
            capabilities=["cap1"],
            namespaces=["ns1"],
            attack_dump="attack",
            tactics=["TA0001"],
            techniques=["T1059"],
            techniques_id=["T1059.001"],
            mbc_dump="mbc",
            mbc_objectives=["obj1"],
            mbc_behaviors=["beh1"],
            mbc_behaviors_id=["B0001"],
        )
        assert c.capa_dump == "dump"
        assert "cap1" in c.capabilities
        assert "TA0001" in c.tactics


# ============================================================================
# Malcontent
# ============================================================================

class TestMalcontentDataclass:
    def test_creation(self):
        from redb.models.dataclasses import Malcontent

        m = Malcontent(
            malcontent_dump='{"RiskScore": 2}',
            version="malcontent v1.0.0",
            risk_score=2,
            risk_level="MEDIUM"
        )
        assert m.malcontent_dump == '{"RiskScore": 2}'
        assert m.version == "malcontent v1.0.0"
        assert m.risk_score == 2
        assert m.risk_level == "MEDIUM"

    def test_with_json_content(self):
        from redb.models.dataclasses import Malcontent
        import json

        # Now stores unwrapped content (without Files/<path> wrapper)
        file_content = {
            "RiskScore": 3,
            "RiskLevel": "HIGH",
            "IsMalcontent": True,
            "Behaviors": [
                {"RuleName": "exec/shell", "RiskLevel": "HIGH", "Description": "executes shell commands"}
            ]
        }
        m = Malcontent(
            malcontent_dump=json.dumps(file_content),
            version="v0.5.0",
            risk_score=3,
            risk_level="HIGH"
        )
        parsed = json.loads(m.malcontent_dump)
        assert parsed["RiskLevel"] == "HIGH"
        assert parsed["Behaviors"][0]["RuleName"] == "exec/shell"

    def test_asdict(self):
        from redb.models.dataclasses import Malcontent
        from dataclasses import asdict

        m = Malcontent(malcontent_dump="{}", version="v1", risk_score=0, risk_level="")
        d = asdict(m)
        assert d == {"malcontent_dump": "{}", "version": "v1", "risk_score": 0, "risk_level": ""}


# ============================================================================
# String
# ============================================================================

class TestStringDataclass:
    def test_creation(self):
        from redb.models.dataclasses import String

        s = String(string="hello", string_length=5, string_entropy=2.3, string_frequency=10)
        assert s.string == "hello"
        assert s.md5 == []
        assert s.sha1 == []
        assert s.sha256 == []

    def test_with_hashes(self):
        from redb.models.dataclasses import String

        s = String(
            string="test", string_length=4, string_entropy=2.0, string_frequency=1,
            md5=["abc"], sha256=["def"],
        )
        assert s.md5 == ["abc"]
        assert s.sha256 == ["def"]


# ============================================================================
# PE Dataclasses
# ============================================================================

class TestPEDataclass:
    def test_required_fields(self):
        from redb.models.dataclasses import PE

        pe = PE(
            dos_header="dos", nt_header="nt", optional_header="opt",
            file_header="fh", magic="0x10b", entry_point="0x1000",
            major_linker_version=14, minor_linker_version=0,
            target_machine="I386", architecture="x86",
            compilation_time=1609459200, compilation_time_utc="2021-01-01T00:00:00",
            is_dotnet=False, is_signed=False, has_overlay=False,
            number_of_sections=4, number_of_imports=10,
            number_of_exports=0, number_of_resources=2,
            type="EXE",
        )
        assert pe.architecture == "x86"
        assert pe.type == "EXE"

    def test_optional_fields_default_none(self):
        from redb.models.dataclasses import PE

        pe = PE(
            dos_header="d", nt_header="n", optional_header="o",
            file_header="f", magic="m", entry_point="e",
            major_linker_version=0, minor_linker_version=0,
            target_machine="t", architecture="a",
            compilation_time=0, compilation_time_utc="",
            is_dotnet=False, is_signed=False, has_overlay=False,
            number_of_sections=0, number_of_imports=0,
            number_of_exports=0, number_of_resources=0,
            type="DLL",
        )
        assert pe.dbg_struct is None
        assert pe.tls_struct is None
        assert pe.rich_header_dump is None
        assert pe.version_info is None


class TestPEImportDataclass:
    def test_creation(self):
        from redb.models.dataclasses import PEImport

        pi = PEImport(pe_imports_total=5)
        assert pi.pe_imports_total == 5
        assert pi.pe_import_libraryName is None
        assert pi.pe_import_functions is None


class TestPESectionDataclass:
    def test_creation(self):
        from redb.models.dataclasses import PESection

        ps = PESection(
            _id="sec_id", section_entropy=6.5, section_sha256="sha",
            section_md5="md5", section_name=".text", section_name_b64=".text",
            section_pointer_to_raw_data="0x400",
            section_size=4096, section_v_addr="0x1000",
            section_v_addr_hex="0x1000", section_v_size=8192,
        )
        assert ps.section_name == ".text"
        assert ps.section_entropy == 6.5


class TestPEResourceDataclass:
    def test_creation(self):
        from redb.models.dataclasses import PEResource

        pr = PEResource(
            _id="res_id", resource_type="RT_ICON", resource_entropy=3.5,
            resource_sha256="sha", resource_filetype="image/png",
            resource_magika="png", resource_language="LANG_ENGLISH",
            resource_sub_lang="SUBLANG_DEFAULT",
            resource_rva="0x2000", resource_size=1024,
        )
        assert pr.resource_type == "RT_ICON"


class TestPEOverlayDataclass:
    def test_creation(self):
        from redb.models.dataclasses import PEOverlay

        po = PEOverlay(
            _id="ovl_id", overlay_size=512, overlay_entropy=7.9,
            overlay_offset="0x5000", overlay_mimetype="application/octet-stream",
            overlay_type="data", overlay_magika="unknown",
            overlay_sha256="sha", overlay_sha1="sha1", overlay_md5="md5",
        )
        assert po.overlay_size == 512


class TestPESignerDataclass:
    def test_creation(self):
        from redb.models.dataclasses import PESigner

        ps = PESigner(
            signer_serial_number="01", signer_subject="CN=Test",
            signer_issuer="CN=CA", signer_valid_from="2021-01-01",
            signer_valid_to="2025-01-01", signer_thumbprint="aabb",
            signer_algorithm="sha256WithRSAEncryption",
        )
        assert ps.signer_subject == "CN=Test"


class TestPECertificateDataclass:
    def test_creation(self):
        from redb.models.dataclasses import PECertificate

        pc = PECertificate(
            certificate_serial_number="02", certificate_subject="CN=Cert",
            certificate_issuer="CN=CA", certificate_valid_from="2021-01-01",
            certificate_valid_to="2025-01-01", certificate_thumbprint="ccdd",
            certificate_algorithm="sha256",
        )
        assert pc.certificate_serial_number == "02"


class TestPECodeSigningInfoDataclass:
    def test_creation(self):
        from redb.models.dataclasses import PECodeSigningInfo

        cs = PECodeSigningInfo(
            _id="cs_id", signature_verified=True, number_of_certificates=2,
        )
        assert cs.signature_verified is True
        assert cs.x509_certificates is None

    def test_with_certificates(self):
        from redb.models.dataclasses import PECodeSigningInfo

        cs = PECodeSigningInfo(
            _id="cs_id", signature_verified=False, number_of_certificates=0,
            x509_certificates=[{"cn": "test"}],
        )
        assert len(cs.x509_certificates) == 1


class TestPEExtraFindingDataclass:
    def test_creation(self):
        from redb.models.dataclasses import PEExtraFinding

        ef = PEExtraFinding(context="anomaly_detection")
        assert ef.context == "anomaly_detection"
        assert ef.finding is None


class TestPEDotNetDataclass:
    def test_creation(self):
        from redb.models.dataclasses import PEDotNet

        dn = PEDotNet()
        assert dn.dotnet == {}

    def test_with_data(self):
        from redb.models.dataclasses import PEDotNet

        dn = PEDotNet(dotnet={"runtime": "v4.0.30319"})
        assert dn.dotnet["runtime"] == "v4.0.30319"


class TestDotNetInconsistencyTestsDataclass:
    def test_creation(self):
        from redb.models.dataclasses import DotNetInconsistencyTests

        it = DotNetInconsistencyTests(
            test_dotnet_data_dir_hidden=False,
            test_dotnet_fake_types=True,
            test_dotnet_extra_data=None,
            test_dotnet_invalid_type_ref=False,
            test_dotnet_fake_datastreams=False,
            test_dotnet_extra_module_table=None,
            test_dotnet_extra_assembly_table=False,
            test_dotnet_invalid_strings_stream=False,
            test_dotnet_streams_mixed_case=True,
            test_dotnet_method_def_invalid_table=False,
            test_dotnet_max_len_exceeding_strings=False,
        )
        assert it.test_dotnet_fake_types is True
        assert it.test_dotnet_extra_data is None


class TestPEInconsistencyTestsDataclass:
    def test_creation(self):
        from redb.models.dataclasses import PEInconsistencyTests

        it = PEInconsistencyTests(
            test_rich_header_checksum=True,
            test_rich_header_duplicate=False,
            test_rich_header_linker=None,
            test_rich_header_import_count=True,
        )
        assert it.test_rich_header_checksum is True
        assert it.test_rich_header_linker is None


# ============================================================================
# YARA Dataclasses
# ============================================================================

class TestYaraRuleDataclass:
    def test_creation(self):
        from redb.models.dataclasses import YaraRule

        yr = YaraRule(
            rule_name="test_rule",
            rule_tags=["malware", "trojan"],
            rule_meta={"author": "test", "description": "A test rule"},
        )
        assert yr.rule_name == "test_rule"
        assert "malware" in yr.rule_tags


class TestYaraMatchDataclass:
    def test_creation(self):
        from redb.models.dataclasses import YaraMatch

        ym = YaraMatch(rule_name="test_rule", match_strings=["$s1", "$s2"])
        assert ym.rule_name == "test_rule"
        assert len(ym.match_strings) == 2


# ============================================================================
# ELF Dataclasses
# ============================================================================

class TestELFFeaturesDataclass:
    def test_creation(self):
        from redb.models.dataclasses import ELFFeatures

        ef = ELFFeatures(
            ei_class=2, ei_data=1, ei_version=1, ei_osabi=0, ei_abiversion=0,
            e_type=2, e_machine=62, e_version=1, e_entry=0x400000, e_flags=0,
            ei_class_str="ELFCLASS64", ei_data_str="ELFDATA2LSB",
            ei_osabi_str="ELFOSABI_SYSV", e_type_str="ET_EXEC",
            e_machine_str="EM_X86_64",
            is_64bit=1, is_stripped=0, is_pie=0, has_canary=1, has_nx=1,
            has_relro=1, has_fortify=0,
            number_of_segments=9, number_of_sections=31,
            number_of_symbols=100, number_of_dynamic_symbols=50,
            number_of_relocations=25, number_of_dependencies=5,
            gnu_hash_present=1, has_debug_info=0,
        )
        assert ef.ei_class == 2
        assert ef.e_machine_str == "EM_X86_64"
        assert ef.build_id is None

    def test_with_build_id(self):
        from redb.models.dataclasses import ELFFeatures

        ef = ELFFeatures(
            ei_class=2, ei_data=1, ei_version=1, ei_osabi=0, ei_abiversion=0,
            e_type=3, e_machine=62, e_version=1, e_entry=0, e_flags=0,
            ei_class_str="64", ei_data_str="LE", ei_osabi_str="SYSV",
            e_type_str="DYN", e_machine_str="X86_64",
            is_64bit=1, is_stripped=1, is_pie=1, has_canary=0, has_nx=1,
            has_relro=1, has_fortify=0,
            number_of_segments=8, number_of_sections=28,
            number_of_symbols=0, number_of_dynamic_symbols=30,
            number_of_relocations=10, number_of_dependencies=3,
            gnu_hash_present=1, has_debug_info=0,
            build_id="abc123def456",
        )
        assert ef.build_id == "abc123def456"


class TestELFDependencyDataclass:
    def test_creation(self):
        from redb.models.dataclasses import ELFDependency

        dep = ELFDependency(
            dependency_name="libc.so.6",
            dependency_type=1,
            dependency_type_str="NEEDED",
        )
        assert dep.dependency_name == "libc.so.6"


class TestELFImportDataclass:
    def test_creation(self):
        from redb.models.dataclasses import ELFImport

        ei = ELFImport(elf_imports_total=3)
        assert ei.elf_imports_total == 3
        assert ei.elf_import_libraries == []
        assert ei.elf_import_functions == []


class TestELFExportDataclass:
    def test_creation(self):
        from redb.models.dataclasses import ELFExport

        ee = ELFExport(elf_exports_total=5)
        assert ee.elf_exports_total == 5
        assert ee.elf_export_functions == []


class TestELFSectionDataclass:
    def test_creation(self):
        from redb.models.dataclasses import ELFSection

        es = ELFSection(
            section_name=".text", section_type=1, section_type_str="SHT_PROGBITS",
            section_flags=6, section_flags_str=["SHF_ALLOC", "SHF_EXECINSTR"],
            section_addr=0x400000, section_offset=0x1000, section_size=4096,
            section_link=0, section_info=0, section_addralign=16, section_entsize=0,
            section_entropy=6.8, section_sha256="sha", section_md5="md5",
        )
        assert es.section_name == ".text"
        assert "SHF_ALLOC" in es.section_flags_str


class TestELFSegmentDataclass:
    def test_creation(self):
        from redb.models.dataclasses import ELFSegment

        seg = ELFSegment(
            segment_type=1, segment_type_str="PT_LOAD",
            segment_flags=5, segment_flags_str=["PF_R", "PF_X"],
            segment_offset=0, segment_vaddr=0x400000, segment_paddr=0x400000,
            segment_filesz=0x1000, segment_memsz=0x1000, segment_align=0x200000,
            segment_entropy=5.5, segment_sha256="sha", segment_md5="md5",
        )
        assert seg.segment_type_str == "PT_LOAD"


class TestELFSymbolDataclass:
    def test_creation(self):
        from redb.models.dataclasses import ELFSymbol

        sym = ELFSymbol(
            symbol_name="main", symbol_value=0x401000, symbol_size=100,
            symbol_type=2, symbol_type_str="STT_FUNC",
            symbol_bind=1, symbol_bind_str="STB_GLOBAL",
            symbol_visibility=0, symbol_visibility_str="STV_DEFAULT",
            symbol_section_index=14, symbol_section_index_str="14",
            is_dynamic=0,
        )
        assert sym.symbol_name == "main"
        assert sym.symbol_type_str == "STT_FUNC"


class TestELFRelocationDataclass:
    def test_creation(self):
        from redb.models.dataclasses import ELFRelocation

        rel = ELFRelocation(
            relocation_offset=0x601000, relocation_type=7,
            relocation_type_str="R_X86_64_JUMP_SLOT",
            relocation_symbol_index=1, relocation_symbol_name="printf",
            relocation_section=".rela.plt",
        )
        assert rel.relocation_addend is None

    def test_with_addend(self):
        from redb.models.dataclasses import ELFRelocation

        rel = ELFRelocation(
            relocation_offset=0x601000, relocation_type=7,
            relocation_type_str="R_X86_64_JUMP_SLOT",
            relocation_symbol_index=1, relocation_symbol_name="printf",
            relocation_section=".rela.plt",
            relocation_addend=-4,
        )
        assert rel.relocation_addend == -4


class TestELFNoteDataclass:
    def test_creation(self):
        from redb.models.dataclasses import ELFNote

        note = ELFNote(
            note_name="GNU", note_type=3,
            note_type_str="NT_GNU_BUILD_ID",
            note_desc="abc123", note_section=".note.gnu.build-id",
        )
        assert note.note_name == "GNU"
        assert note.note_type_str == "NT_GNU_BUILD_ID"


# ============================================================================
# Decompiled
# ============================================================================

class TestDecompiledDataclass:
    def test_creation(self):
        from redb.models.dataclasses import Decompiled

        d = Decompiled(
            _id="func_hash",
            decompiled_function_name="main",
            decompiled_function_address="0x401000",
            decompiled_function="int main() { return 0; }",
        )
        assert d.decompiled_function_name == "main"