Skip to content

merge xAOD::ReturnCode into StatusCode, migrate all users

Nils Erik Krumnack requested to merge krumnack/athena:return_code into master

This has been a long time coming, but one of the reasons for having AsgMessaging as a separate package from AsgTools is to allow xAODRootAccess to depend on it and use the same status codes and messaging as the rest of analysis base. This should take part of the former.

I had to add the RECOVERABLE code to the main status code, but since that is also part of the Gaudi StatusCode that seems like a reasonable change/extension.

Most of this MR is just a global search replace to move all users from TReturnCode to StatusCode, and apart from fixing up a couple of places related to the status code itself I did not try to fix/improve any code in the process. Please keep the review itself focused on the status code changes as well.

I had discussed this particular change with @akraszna a while back. Not sure if he has any specific comments on the way I did it.

Unfortunately this MR also revealed a bug in the RETURN_CHECK() macro, which is/was used in a number of unit tests and made them incorrectly report success if they should have reported failure. More specifically, if it discovers the wrapped call fails it would return a TReturnCode::kFailure/StatusCode::FAILURE, which when converted to int has the value 0, which when used as a return value from main() gets interpreted as success by ctest. For the most part I replaced the RETURN_CHECK() calls in unit tests with ANA_CHECK() which avoids this particular issue. However, except for a few cases in which it was straightforward, I did not attempt to fix the actual tests, which are often very specialized and likely require domain experts to fix.

Adding the full-unit-tests label, as this touches some very core classes.

Edited by Nils Erik Krumnack

Merge request reports