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

Side by Side Diff: tests/CPlusPlusEleven.cpp

Issue 2193973002: SkPDF: PDFShader code modernized. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-08-02 (Tuesday) 17:24:52 EDT Created 4 years, 4 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 | « src/pdf/SkPDFTypes.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 17 matching lines...) Expand all
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 31
32 DEF_TEST(CPlusPlusEleven_constexpr, r) { 32 DEF_TEST(CPlusPlusEleven_constexpr, r) {
33 static constexpr int x = Sk32ToBool(50); 33 static constexpr int x = Sk32ToBool(50);
34 REPORTER_ASSERT(r, x == 1); 34 REPORTER_ASSERT(r, x == 1);
35 static constexpr int y = SkTPin<int>(100, 0, 10); 35 static constexpr int y = SkTPin<int>(100, 0, 10);
36 REPORTER_ASSERT(r, y == 10); 36 REPORTER_ASSERT(r, y == 10);
37 } 37 }
38
39 namespace {
40 struct MoveableCopyable {
41 bool fCopied;
42 MoveableCopyable() : fCopied(false) {}
43 MoveableCopyable(const MoveableCopyable &o) : fCopied(true) {}
44 MoveableCopyable(MoveableCopyable &&o) : fCopied(o.fCopied) {}
45 };
46 struct TestClass {
47 MoveableCopyable fFoo;
48 };
49 } // namespace
50
51 DEF_TEST(CPlusPlusEleven_default_move, r) {
52 TestClass a;
53 TestClass b(a);
54 TestClass c(std::move(a));
55 REPORTER_ASSERT(r, b.fFoo.fCopied);
56 REPORTER_ASSERT(r, !c.fFoo.fCopied);
57 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFTypes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698