Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.

Commit 61fb629

Browse files
Add a unit test for the fuzz target
1 parent 8937329 commit 61fb629

File tree

6 files changed

+10
-0
lines changed

6 files changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import sys
22
import math
3+
import os
4+
import pytest
35

46
from msgpack import _cmsgpack, fallback
57

@@ -30,6 +32,14 @@ def TestOneInput(data):
3032
)
3133

3234

35+
SCRIPT_DIR = os.path.dirname(__file__)
36+
CORPUS_DIR = os.path.join(SCRIPT_DIR, "test_differential_fuzzer_seed_corpus")
37+
CORPUS = [open(os.path.join(CORPUS_DIR, f), 'rb').read() for f in os.listdir(CORPUS_DIR)]
38+
@pytest.mark.parametrize('data', CORPUS)
39+
def test_try_the_seed_corpus(data):
40+
TestOneInput(data)
41+
42+
3343
def main():
3444
import atheris
3545

File renamed without changes.
File renamed without changes.

fuzz/differential_fuzzer_seed_corpus/ExcessiveNesting renamed to fuzz/test_differential_fuzzer_seed_corpus/ExcessiveNesting

File renamed without changes.

fuzz/differential_fuzzer_seed_corpus/OpenWeatherMap renamed to fuzz/test_differential_fuzzer_seed_corpus/OpenWeatherMap

File renamed without changes.

fuzz/differential_fuzzer_seed_corpus/WeatherUnderground renamed to fuzz/test_differential_fuzzer_seed_corpus/WeatherUnderground

File renamed without changes.

0 commit comments

Comments
 (0)