GrammaTech / gtirb

Intermediate Representation for Binary analysis and transformation
https://grammatech.github.io/gtirb/
Other
305 stars 36 forks source link

CL specific: assuming the order in maphash #40

Closed Yehouda closed 3 years ago

Yehouda commented 3 years ago

The test idempotent-aux-data-decode-encode compares the result of gtirb::aux-data-encode to the original data. But if the data argument to gtirb::aux-data-encode is a hash-table, it goes through the elements using maphash (inside encode). The order in which maphash goes through the elements is uspecified, and can be different between calls. Therefore this test sometimes fails in this situation.

If the order of the elements needs to be fixd, then encode needs to be fixed to sort the table first somehow, or never use a hash-table for the data. If the order does not need to be fixed, then the test needs to be fixed to not test for it.