forked from LORD-MicroStrain/ntrip_client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add simple fuzz testing for parsers
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
try: | ||
import atheris | ||
except ImportError: | ||
raise ImportError("You need to install atheris to run this script.") | ||
import sys | ||
|
||
with atheris.instrument_imports(): | ||
from ..ntrip_client.nmea_parser import NMEAParser | ||
|
||
|
||
def TestOneInput(data): | ||
parser = NMEAParser() | ||
parser.is_valid_sentence(data) | ||
|
||
|
||
atheris.Setup(sys.argv, TestOneInput) | ||
atheris.Fuzz() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
try: | ||
import atheris | ||
except ImportError: | ||
raise ImportError("You need to install atheris to run this script.") | ||
import sys | ||
|
||
with atheris.instrument_imports(): | ||
from ..ntrip_client.rtcm_parser import RTCMParser | ||
|
||
|
||
def TestOneInput(data): | ||
parser = RTCMParser() | ||
parser.parse(data) | ||
|
||
|
||
atheris.Setup(sys.argv, TestOneInput) | ||
atheris.Fuzz() | ||
|