Make assertEqualMem() ignore offset if duplex=off

If duplex is 'off' we don't need to obsess over the offset value,
which is unused anyway. Some drivers may not be able to store an
offset if duplex=off and/or may use the offset for signaling of that
fact.
This commit is contained in:
Dan Smith 2024-03-19 21:18:15 -07:00 committed by Dan Smith
parent 74a8717dc6
commit 985b78aa4f

View File

@ -132,6 +132,14 @@ class DriverTest(unittest.TestCase):
def assertEqualMem(self, a, b, ignore=None):
if a.tmode == "Cross":
tx_mode, rx_mode = a.cross_mode.split("->")
if ignore is None:
ignore = []
if a.duplex == b.duplex == 'off':
# If we're asking for duplex=off, we should not obsess over the
# driver keeping track of our offset, as it may use the offset
# field to manage the TX behavior
ignore.append('offset')
a_vals = {}
b_vals = {}