diff --git a/poetry.lock b/poetry.lock index 7fa770a..c34d45b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -20,6 +20,14 @@ six = "*" [package.extras] test = ["astroid", "pytest"] +[[package]] +name = "atheris" +version = "2.0.10" +description = "A coverage-guided fuzzer for Python and Python extensions." +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "atomicwrites" version = "1.4.0" @@ -509,7 +517,7 @@ python-versions = "*" [metadata] lock-version = "1.1" python-versions = "^3.8,<3.10" -content-hash = "8ea36a899ad85e7854524e233e51ffc01d2cdf5b493549f1d10536a5f706fc63" +content-hash = "c7b281b4bcf5107125b5e78222fce9c3a8700315829a0d72d46e1f2e73381d55" [metadata.files] appnope = [ @@ -520,6 +528,18 @@ asttokens = [ {file = "asttokens-2.0.5-py2.py3-none-any.whl", hash = "sha256:0844691e88552595a6f4a4281a9f7f79b8dd45ca4ccea82e5e05b4bbdb76705c"}, {file = "asttokens-2.0.5.tar.gz", hash = "sha256:9a54c114f02c7a9480d56550932546a3f1fe71d8a02f1bc7ccd0ee3ee35cf4d5"}, ] +atheris = [ + {file = "atheris-2.0.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a0af6f129b36d31afcb67d13cd6ee7c8ef3ab0a3ebf73513ab191dcd3de99a1b"}, + {file = "atheris-2.0.10-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:dc639dbe84d39cb5ae895c268a6acc580fab7316285ac458609c998acee972a4"}, + {file = "atheris-2.0.10-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ecc005a58fd02b61833d542d764c7f676c7ab4445a8ec8b7d1ca6e2891d6079d"}, + {file = "atheris-2.0.10-cp37-cp37m-macosx_11_0_x86_64.whl", hash = "sha256:94ff2c0338b2f1f0363cdbe618eae03bf993186961f911e6443518ec1b77dfae"}, + {file = "atheris-2.0.10-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10872a58da0249a68ef430e0d9d96c57697585bd64118127f0ece254206c7f58"}, + {file = "atheris-2.0.10-cp38-cp38-macosx_11_0_x86_64.whl", hash = "sha256:a6ff59ed75a67d81dfab07c5cebf70f04a7f54b75e3e778245fa3fb65effc4ad"}, + {file = "atheris-2.0.10-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:81e3ec251062bba569147182685260dc1cc19128839d4f30202d4f210e9da0ac"}, + {file = "atheris-2.0.10-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:50ccc8fb904b6ea6c585dcedf11aa9dd8768c077cfc25f991e0526dabe57a1f0"}, + {file = "atheris-2.0.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1667acbc6cd06b3dcba6520be4c38699d8cb27629f01d34f1b87a6a8f512a24d"}, + {file = "atheris-2.0.10.tar.gz", hash = "sha256:c387fac19e49c7c1b4d3ca125164ee69e6dc63a12bc2e7fe8c8527c233f0cba0"}, +] atomicwrites = [ {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, diff --git a/pyproject.toml b/pyproject.toml index 1e13336..9f5a2bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,7 @@ pytest-cov = "^3.0.0" mypy = "^0.942" ipython = "^8.2.0" black = "^22.3.0" +atheris = "^2.0.10" [build-system] requires = ["poetry>=0.12"] diff --git a/scripts/fuzz.py b/scripts/fuzz.py new file mode 100644 index 0000000..e60cbc5 --- /dev/null +++ b/scripts/fuzz.py @@ -0,0 +1,12 @@ +import atheris + +with atheris.instrument_imports(): + import pdme + import pdme.util.normal_form + import sys + +def test_pdme(pt): + pdme.util.normal_form.flip_chunk_to_positive_px(pt) + +atheris.Setup(sys.argv, test_pdme) +atheris.Fuzz()