1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-19 19:25:18 +02:00

Fix various code & correctness issues (#11815)

This commit is contained in:
sfan5
2021-12-05 14:40:30 +01:00
committed by GitHub
parent 7a043b3ebb
commit ff934d538c
8 changed files with 30 additions and 37 deletions

View File

@@ -392,9 +392,9 @@ void TestUtilities::testIsPowerOfTwo()
UASSERT(is_power_of_two(2) == true);
UASSERT(is_power_of_two(3) == false);
for (int exponent = 2; exponent <= 31; ++exponent) {
UASSERT(is_power_of_two((1 << exponent) - 1) == false);
UASSERT(is_power_of_two((1 << exponent)) == true);
UASSERT(is_power_of_two((1 << exponent) + 1) == false);
UASSERT(is_power_of_two((1U << exponent) - 1) == false);
UASSERT(is_power_of_two((1U << exponent)) == true);
UASSERT(is_power_of_two((1U << exponent) + 1) == false);
}
UASSERT(is_power_of_two(U32_MAX) == false);
}
@@ -629,4 +629,4 @@ void TestUtilities::testBase64()
UASSERT(base64_is_valid("AAA=A") == false);
UASSERT(base64_is_valid("AAAA=A") == false);
UASSERT(base64_is_valid("AAAAA=A") == false);
}
}