diff options
author | halcanary <halcanary@google.com> | 2016-05-23 09:11:58 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-23 09:11:59 -0700 |
commit | a0af771612db5ae36b74f1f536bfb335ecd0ec99 (patch) | |
tree | 5bce33c400039d9a5a39d08269dd574e69858735 /tests | |
parent | f0270c32c1c4024f60788265518fec103de4b4eb (diff) |
SkTypes: use constexpr when appropriate
motivation: https://codereview.chromium.org/2000853003
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2004073002
Review-Url: https://codereview.chromium.org/2004073002
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CPlusPlusEleven.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/CPlusPlusEleven.cpp b/tests/CPlusPlusEleven.cpp index 5fbd46429d..b5a34b2264 100644 --- a/tests/CPlusPlusEleven.cpp +++ b/tests/CPlusPlusEleven.cpp @@ -28,3 +28,10 @@ DEF_TEST(CPlusPlusEleven_RvalueAndMove, r) { Moveable src1; Moveable dst1(std::move(src1)); Moveable src2, dst2; dst2 = std::move(src2); } + +DEF_TEST(CPlusPlusEleven_constexpr, r) { + static constexpr int x = Sk32ToBool(50); + REPORTER_ASSERT(r, x == 1); + static constexpr int y = SkTPin<int>(100, 0, 10); + REPORTER_ASSERT(r, y == 10); +} |