Skip to content

TESTS: zero-allocate fileid_t with {} for typedef-invariant false val

Kane Bruce requested to merge kbruce/eos:master into master

A slight bug was found in the FileId.DefaultConstructor test found in unit_tests/common/FileIdTests.cc, given that the unit test failed on it implying that the default integer value was non-false (!= 0). This was attributed to its initialization, since the underlying type is an unsigned long long, whose default construction is implementation-dependent.

fid {} is a C zero-allocate technique that was used to fix this issue, and the test passes with the slight modification.

Merge request reports