Skip to content

Commit 59b5b4d

Browse files
committed
fix issue ebroecker#559
Signed-off-by: An Nguyen <[email protected]>
1 parent a798bfc commit 59b5b4d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/canmatrix/compare.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,11 @@ def compare_db(db1, db2, ignore=None):
7373
for f1 in db1.frames:
7474
f2 = db2.frame_by_name(f1.name)
7575
f2id = db2.frame_by_id(f1.arbitration_id)
76-
if f2id is None and f2 is None:
77-
result.add_child(CompareResult("deleted", "FRAME", f1))
76+
if f2 is None:
77+
if f2id is None:
78+
result.add_child(CompareResult("deleted", "FRAME", f1))
79+
else:
80+
result.add_child(compare_frame(f1, f2id, ignore))
7881
else:
7982
result.add_child(compare_frame(f1, f2, ignore))
8083
for f2 in db2.frames:
@@ -312,6 +315,13 @@ def compare_frame(f1, f2, ignore=None):
312315
"dlc: %d" %
313316
f1.size, "dlc: %d" %
314317
f2.size]))
318+
if f1.arbitration_id.id != f2.arbitration_id.id:
319+
result.add_child(
320+
CompareResult(
321+
"changed", "ID", f1, [
322+
"ID: %xh" %
323+
f1.arbitration_id.id, "ID: %xh" %
324+
f2.arbitration_id.id]))
315325
if f1.arbitration_id.extended != f2.arbitration_id.extended:
316326
result.add_child(
317327
CompareResult(

0 commit comments

Comments
 (0)