binary_function_similarity icon indicating copy to clipboard operation
binary_function_similarity copied to clipboard

The test code may have a little problem when using assertDictEqual

Open F01ivor4 opened this issue 2 years ago • 1 comments

In IDA_scripts' test code, like test_large_acfg_disasm.py in IDA_acfg_disasm, the code uses assertDictEqual to test if the data feature that readers reproduce is the same as gt's.

However, assertDictEqual will think {'a': [[2, 3], [3, 2]]} != {'a': [[3, 2], [2, 3]]}. But when we reproduce the data feature, like ACFG's edge, we may get different orders of edges, which is also correct.

This is not a big problem, I just hope that the person replicating the code will be aware of this when the test fails.

F01ivor4 avatar Oct 04 '22 08:10 F01ivor4

Thanks @LJianCode for reporting this issue. This needs to be fixed.

jimmy-sonny avatar Oct 07 '22 13:10 jimmy-sonny