Skip to content

Commit

Permalink
feat: add simple fuzz testing for NMEA/RTCM parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
cktii committed May 14, 2024
1 parent a385863 commit f7099dd
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/ntrip_client/nmea_fuzz_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
try:
import atheris
except ImportError:
raise ImportError("You need to install atheris to run this script.")
import sys

with atheris.instrument_imports():
from nmea_parser import NMEAParser


def TestOneInput(data):
parser = NMEAParser()
parser.is_valid_sentence(data)


atheris.Setup(sys.argv, TestOneInput)
atheris.Fuzz()
17 changes: 17 additions & 0 deletions src/ntrip_client/rtcm_fuzz_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
try:
import atheris
except ImportError:
raise ImportError("You need to install atheris to run this script.")
import sys

with atheris.instrument_imports():
from rtcm_parser import RTCMParser


def TestOneInput(data):
parser = RTCMParser()
parser.parse(data)


atheris.Setup(sys.argv, TestOneInput)
atheris.Fuzz()

0 comments on commit f7099dd

Please sign in to comment.