diff options
| author | 2019-03-28 21:41:40 -0400 | |
|---|---|---|
| committer | 2019-03-28 21:41:40 -0400 | |
| commit | b404fcdf1443b91ac9994c05ad1fe039fcd9675e (patch) | |
| tree | 42b6141dcd6a5315f9330f064524963a7915c28a /src/tests/common/bit_utils.cpp | |
| parent | Merge pull request #2284 from lioncash/heap-alloc (diff) | |
| parent | Fixes and corrections on formatting. (diff) | |
| download | yuzu-b404fcdf1443b91ac9994c05ad1fe039fcd9675e.tar.gz yuzu-b404fcdf1443b91ac9994c05ad1fe039fcd9675e.tar.xz yuzu-b404fcdf1443b91ac9994c05ad1fe039fcd9675e.zip | |
Merge pull request #2265 from FernandoS27/multilevelqueue
Replace old Thread Queue for a new Multi Level Queue
Diffstat (limited to '')
| -rw-r--r-- | src/tests/common/bit_utils.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tests/common/bit_utils.cpp b/src/tests/common/bit_utils.cpp new file mode 100644 index 000000000..479b5995a --- /dev/null +++ b/src/tests/common/bit_utils.cpp | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | // Copyright 2017 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <catch2/catch.hpp> | ||
| 6 | #include <math.h> | ||
| 7 | #include "common/bit_util.h" | ||
| 8 | |||
| 9 | namespace Common { | ||
| 10 | |||
| 11 | TEST_CASE("BitUtils::CountTrailingZeroes", "[common]") { | ||
| 12 | REQUIRE(Common::CountTrailingZeroes32(0) == 32); | ||
| 13 | REQUIRE(Common::CountTrailingZeroes64(0) == 64); | ||
| 14 | REQUIRE(Common::CountTrailingZeroes32(9) == 0); | ||
| 15 | REQUIRE(Common::CountTrailingZeroes32(8) == 3); | ||
| 16 | REQUIRE(Common::CountTrailingZeroes32(0x801000) == 12); | ||
| 17 | REQUIRE(Common::CountTrailingZeroes64(9) == 0); | ||
| 18 | REQUIRE(Common::CountTrailingZeroes64(8) == 3); | ||
| 19 | REQUIRE(Common::CountTrailingZeroes64(0x801000) == 12); | ||
| 20 | REQUIRE(Common::CountTrailingZeroes64(0x801000000000UL) == 36); | ||
| 21 | } | ||
| 22 | |||
| 23 | } // namespace Common | ||