3 # Tests for crashing functions
6 from unittest
import TestCase
14 def segfault_detector(f
):
15 def wrapper(*args
, **kwargs
):
21 except Exception as e
:
28 pid2
, status
= os
.waitpid(pid
, 0)
29 if os
.WIFSIGNALED(status
):
30 signal
= os
.WTERMSIG(status
)
31 raise AssertionError("Failed with signal %d" % signal
)
36 class LdbDnCrashTests(TestCase
):
38 def test_ldb_dn_explode_crash(self
):
39 for i
in range(106, 150):
40 dn
= ldb
.Dn(ldb
.Ldb(), "a=b%s,c= " % (' ' * i
))
43 if __name__
== '__main__':
45 unittest
.TestProgram()