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

Side by Side Diff: tests/ScopedTest.cpp

Issue 2274863002: sk_at_scope_end (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use it! Created 4 years, 3 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
« src/codec/SkWebpCodec.cpp ('K') | « src/codec/SkWebpCodec.cpp ('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
(Empty)
1 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "Test.h"
9
10 static void dec(int* p) { (*p)--; }
11
12 DEF_TEST(sk_at_scope_end, r) {
13 int x = 5;
14 {
15 sk_at_scope_end(x--);
16 REPORTER_ASSERT(r, x == 5);
17 }
18 REPORTER_ASSERT(r, x == 4);
19 {
20 sk_at_scope_end(dec(&x));
21 REPORTER_ASSERT(r, x == 4);
22 }
23 REPORTER_ASSERT(r, x == 3);
24 }
OLDNEW
« src/codec/SkWebpCodec.cpp ('K') | « src/codec/SkWebpCodec.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698