From d09cfc04fb29222c39ca4f170982c033fdc8206c Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Mon, 4 Oct 2010 22:56:20 +0400 Subject: unittests: add a test to avoid regression on previous fix Autobuild-User: Matthieu Patou Autobuild-Date: Mon Oct 4 20:23:31 UTC 2010 on sn-devel-104 --- source4/lib/ldb/tests/python/api.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/lib') diff --git a/source4/lib/ldb/tests/python/api.py b/source4/lib/ldb/tests/python/api.py index 4b4415afb1..76de853ac7 100755 --- a/source4/lib/ldb/tests/python/api.py +++ b/source4/lib/ldb/tests/python/api.py @@ -7,6 +7,7 @@ import unittest import ldb + def filename(): return os.tempnam() @@ -321,6 +322,10 @@ class SimpleLdb(unittest.TestCase): res = l.search(expression="(dn=dc=somedn)") self.assertEquals("foo\0bar", res[0]["displayname"][0]) + def test_no_crash_broken_expr(self): + l = ldb.Ldb(filename()) + self.assertRaises(ldb.LdbError,lambda: l.search("", ldb.SCOPE_SUBTREE, "&(dc=*)(dn=*)", ["dc"])) + class DnTests(unittest.TestCase): -- cgit