From d803d31af5b7344e57972a36bd78a8c627320a63 Mon Sep 17 00:00:00 2001 From: Simon Albinsson Date: Thu, 12 Apr 2018 21:38:29 +0000 Subject: [PATCH] test:fixes bug in CRC-coruption routine --- tests/mock_smbus2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/mock_smbus2.py b/tests/mock_smbus2.py index bdd8d20..744c615 100644 --- a/tests/mock_smbus2.py +++ b/tests/mock_smbus2.py @@ -40,7 +40,8 @@ class MockSMBus: for i in range(len(s.status)): msg.buf[i]=chr(s.status[i]) if s._break_crc and i%3 == 2: - msg.buf[i]=msg.buf[i]^42 + msg.buf[i]=chr(s.status[i]^42) + self.status=None def _process_write(s,msg):