OLD | NEW |
---|---|
(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 } | |
OLD | NEW |