summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_xxtestfuzz.py
blob: 15924aaeff38513c8773c3dd070d2f75dfec4fa1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import faulthandler
import test.support
import unittest

_xxtestfuzz = test.support.import_module('_xxtestfuzz')


class TestFuzzer(unittest.TestCase):
    """To keep our https://github.com/google/oss-fuzz API working."""

    def test_sample_input_smoke_test(self):
        """This is only a regression test: Check that it doesn't crash."""
        _xxtestfuzz.run(b"")
        _xxtestfuzz.run(b"\0")
        _xxtestfuzz.run(b"{")
        _xxtestfuzz.run(b" ")
        _xxtestfuzz.run(b"x")
        _xxtestfuzz.run(b"1")
        _xxtestfuzz.run(b"AAAAAAA")
        _xxtestfuzz.run(b"AAAAAA\0")


if __name__ == "__main__":
    faulthandler.enable()
    unittest.main()