mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Avoid the potential negative left shift in test_xaccAccountType_Compatibility()
ACCT_TYPE_NONE is -1 but it should always be masked out by compat; explicitly check for this instead of relying on that. Add parenthesis to be clear that the default precedence is what's intended.
This commit is contained in:
@@ -2587,7 +2587,7 @@ test_xaccAccountType_Compatibility (void)
|
||||
else if (type == ACCT_TYPE_TRADING)
|
||||
g_assert_cmpint (compat, == , trading_compat);
|
||||
for (auto parent = ACCT_TYPE_NONE; parent < ACCT_TYPE_LAST; ++parent)
|
||||
if (1 << parent & compat)
|
||||
if (parent != ACCT_TYPE_NONE && (1 << parent) & compat)
|
||||
g_assert (xaccAccountTypesCompatible (parent, type));
|
||||
else
|
||||
g_assert (!xaccAccountTypesCompatible (parent, type));
|
||||
|
||||
Reference in New Issue
Block a user