mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ndrdump tests: Make the tests less fragile
Remove the C source file and line number from the expected output to make the tests less likely to break if ndr.c changes. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
b0ba7cd4f9
commit
56e466b4b8
@ -22,6 +22,7 @@ from __future__ import print_function
|
||||
"""Blackbox tests for ndrdump."""
|
||||
|
||||
import os
|
||||
import re
|
||||
from samba.tests import BlackboxTestCase, BlackboxProcessError
|
||||
|
||||
for p in ["../../../../../source4/librpc/tests",
|
||||
@ -436,6 +437,11 @@ dump OK
|
||||
except BlackboxProcessError as e:
|
||||
self.fail(e)
|
||||
|
||||
# Filter out the C source file and line number
|
||||
regex = rb"\.\./\.\./librpc/ndr/ndr\.c:[0-9]+"
|
||||
actual = re.sub(regex, b"", actual)
|
||||
expected = re.sub(regex, b"", expected)
|
||||
|
||||
self.assertEqual(actual, expected)
|
||||
|
||||
# Test a print of NULL pointer in manually-written ndr_drsuapi.c
|
||||
|
Loading…
Reference in New Issue
Block a user