Coverage for /pythoncovmergedfiles/medio/medio/src/cbor2/tests/fuzzers/loads_fuzzer.py: 25%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1###### Coverage stub
2import atexit
3import coverage
4cov = coverage.coverage(data_file='.coverage', cover_pylib=True)
5cov.start()
6# Register an exist handler that will print coverage
7def exit_handler():
8 cov.stop()
9 cov.save()
10atexit.register(exit_handler)
11####### End of coverage stub
12import sys
14import atheris
16# _cbor2 ensures the C library is imported
17from _cbor2 import loads
20def test_one_input(data: bytes):
21 try:
22 loads(data)
23 except Exception:
24 # We're searching for memory corruption, not Python exceptions
25 pass
28if __name__ == "__main__":
29 atheris.Setup(sys.argv, test_one_input)
30 atheris.Fuzz()