diff options
| author | Billy O'Neal <bion@microsoft.com> | 2021-02-04 10:15:44 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-04 10:15:44 -0800 |
| commit | aa60b7efa56a83ead743718941d8b320ef4a05af (patch) | |
| tree | db9f9ebd6fa37598b2f5f2ad564eb858cdeddcb0 /toolsrc/src/vcpkg-test/uint128.cpp | |
| parent | f226416d2eafc495dd03572cb61542fb1670ffdc (diff) | |
| download | vcpkg-aa60b7efa56a83ead743718941d8b320ef4a05af.tar.gz vcpkg-aa60b7efa56a83ead743718941d8b320ef4a05af.zip | |
[vcpkg] Download vcpkg.exe rather than building it in bootstrap on Windows. (#15474)
This reduces bootstrap cost for Windows customers, resolving the issue initially submitted as #12502 .
The `toolsrc` tree was extracted to https://github.com/microsoft/vcpkg-tool. `bootstrap.sh` was changed to download the right source tarball, extract, and build it. This was chosen over the previous attempt, a submodule, over concerns of accidentally destroying people's local modifications.
Diffstat (limited to 'toolsrc/src/vcpkg-test/uint128.cpp')
| -rw-r--r-- | toolsrc/src/vcpkg-test/uint128.cpp | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/toolsrc/src/vcpkg-test/uint128.cpp b/toolsrc/src/vcpkg-test/uint128.cpp deleted file mode 100644 index a13b25e4f..000000000 --- a/toolsrc/src/vcpkg-test/uint128.cpp +++ /dev/null @@ -1,68 +0,0 @@ -#include <catch2/catch.hpp> - -#include <vcpkg/base/uint128.h> - -TEST_CASE ("uint128 constructor and assign", "[uint128]") -{ - vcpkg::UInt128 x = 120; - REQUIRE(x.bottom_64_bits() == 120); - REQUIRE(x.top_64_bits() == 0); - - x = 3201; - REQUIRE(x.bottom_64_bits() == 3201); - REQUIRE(x.top_64_bits() == 0); - - x = 0xFFFF'FFFF'FFFF'FFFF; - REQUIRE(x.bottom_64_bits() == 0xFFFF'FFFF'FFFF'FFFF); - REQUIRE(x.top_64_bits() == 0); -} - -TEST_CASE ("uint128 add-assign", "[uint128]") -{ - vcpkg::UInt128 x = 0xFFFF'FFFF'FFFF'FFFF; - x += 1; - REQUIRE(x.bottom_64_bits() == 0); - REQUIRE(x.top_64_bits() == 1); -} - -TEST_CASE ("uint128 shl-assign", "[uint128]") -{ - vcpkg::UInt128 x = 0xFFFF'FFFF'FFFF'FFFF; - x <<= 32; - REQUIRE(x.bottom_64_bits() == 0xFFFF'FFFF'0000'0000); - REQUIRE(x.top_64_bits() == 0x0000'0000'FFFF'FFFF); - - x <<= 60; - REQUIRE(x.bottom_64_bits() == 0); - REQUIRE(x.top_64_bits() == 0xFFFF'FFFF'F000'0000); - - x = 1; - x <<= 96; - REQUIRE(x.bottom_64_bits() == 0); - REQUIRE(x.top_64_bits() == (uint64_t(1) << 32)); -} - -TEST_CASE ("uint128 shr-assign", "[uint128]") -{ - vcpkg::UInt128 x = 0xFFFF'FFFF'FFFF'FFFF; - x <<= 64; - REQUIRE(x.bottom_64_bits() == 0x0000'0000'0000'0000); - REQUIRE(x.top_64_bits() == 0xFFFF'FFFF'FFFF'FFFF); - - x >>= 32; - REQUIRE(x.bottom_64_bits() == 0xFFFF'FFFF'0000'0000); - REQUIRE(x.top_64_bits() == 0x0000'0000'FFFF'FFFF); - - x >>= 60; - REQUIRE(x.bottom_64_bits() == 0x0000'000F'FFFF'FFFF); - REQUIRE(x.top_64_bits() == 0x0000'0000'0000'0000); - - x = 0x8000'0000'0000'0000; - x <<= 64; - REQUIRE(x.bottom_64_bits() == 0); - REQUIRE(x.top_64_bits() == 0x8000'0000'0000'0000); - - x >>= 96; - REQUIRE(x.bottom_64_bits() == (uint64_t(1) << 31)); - REQUIRE(x.top_64_bits() == 0); -} |
