npwoods/bletchmame

Test::compareBinaries() doesn't work properly on 32 bit architectures

Opened this issue · 2 comments

On armv7hl and i686, the two comparison tests in info_builder_test.cpp fail:

FAIL!  : Test::compareBinaries_coco() 'byteArray.size() == binByteArray.size()' returned FALSE. ()
   Loc: [/builddir/build/BUILD/bletchmame-2.10/src/tests/info_builder_test.cpp(145)]
FAIL!  : Test::compareBinaries_alienar() 'byteArray.size() == binByteArray.size()' returned FALSE. ()
   Loc: [/builddir/build/BUILD/bletchmame-2.10/src/tests/info_builder_test.cpp(145)]

Looks like it's the QVERIFY(byteArray.size() == binByteArray.size()); assert in compareBinaries() that's failing.

You can see full logs for armv7hl (https://koji.fedoraproject.org/koji/taskinfo?taskID=79844074) and i686 (https://koji.fedoraproject.org/koji/taskinfo?taskID=79844075) if you look at "build.log".

Interestingly, this doesn't always fail (you can see in that example that the armv7hl one actually succeeded), so there might be more going on here.

The interesting part here is that the part of this that one would expect to fail did not actually fail.

The purpose of this test is to ensure that generation of the Info DB binaries is indeed deterministic, and that there are not undefined bytes getting persisted. It is not an overall surprise that there might be a bug that does not manifest on x64, but I would expect the problem to manifest as bytes differing, not the size.