| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 #include "Test.h" | 7 #include "Test.h" |
| 8 #include "SkTemplates.h" | 8 #include "SkTemplates.h" |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 template <typename T> void deleter(T*) { } | 21 template <typename T> void deleter(T*) { } |
| 22 template <typename T> struct Deleter { | 22 template <typename T> struct Deleter { |
| 23 void operator()(T* t) { delete static_cast<const Moveable*>(t); } | 23 void operator()(T* t) { delete static_cast<const Moveable*>(t); } |
| 24 }; | 24 }; |
| 25 } // namespace | 25 } // namespace |
| 26 | 26 |
| 27 DEF_TEST(CPlusPlusEleven_RvalueAndMove, r) { | 27 DEF_TEST(CPlusPlusEleven_RvalueAndMove, r) { |
| 28 Moveable src1; Moveable dst1(std::move(src1)); | 28 Moveable src1; Moveable dst1(std::move(src1)); |
| 29 Moveable src2, dst2; dst2 = std::move(src2); | 29 Moveable src2, dst2; dst2 = std::move(src2); |
| 30 } | 30 } |
| 31 |
| 32 DEF_TEST(CPlusPlusEleven_constexpr, r) { |
| 33 static constexpr int x = Sk32ToBool(50); |
| 34 REPORTER_ASSERT(r, x == 1); |
| 35 static constexpr int y = SkTPin<int>(100, 0, 10); |
| 36 REPORTER_ASSERT(r, y == 10); |
| 37 } |
| OLD | NEW |