Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: tests/CPlusPlusEleven.cpp

Issue 2004073002: SkTypes: use constexpr when appropriate (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-05-23 (Monday) 11:56:10 EDT Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/core/SkTypes.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « include/core/SkTypes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698