| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 | 7 |
| 8 #include "SkTDStackNester.h" | 8 #include "SkTDStackNester.h" |
| 9 | 9 |
| 10 #include "Test.h" | 10 #include "Test.h" |
| 11 #include "TestClassDef.h" | |
| 12 | 11 |
| 13 /** | 12 /** |
| 14 * Test SkTDStackNester<int>::push(). Pushes the current count onto the stack, | 13 * Test SkTDStackNester<int>::push(). Pushes the current count onto the stack, |
| 15 * and checks that the count has increased by one. | 14 * and checks that the count has increased by one. |
| 16 */ | 15 */ |
| 17 static void test_push(skiatest::Reporter* reporter, SkTDStackNester<int>* nester
) { | 16 static void test_push(skiatest::Reporter* reporter, SkTDStackNester<int>* nester
) { |
| 18 SkASSERT(nester); | 17 SkASSERT(nester); |
| 19 const int count = nester->count(); | 18 const int count = nester->count(); |
| 20 // test_pop depends on this value. | 19 // test_pop depends on this value. |
| 21 nester->push(count); | 20 nester->push(count); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // Pop everything off the stack except for the last one, to confirm | 101 // Pop everything off the stack except for the last one, to confirm |
| 103 // that the destructor handles a remaining object. | 102 // that the destructor handles a remaining object. |
| 104 while (nester.count() > 1) { | 103 while (nester.count() > 1) { |
| 105 test_pop(reporter, &nester); | 104 test_pop(reporter, &nester); |
| 106 } | 105 } |
| 107 } | 106 } |
| 108 | 107 |
| 109 DEF_TEST(TDStackNester, reporter) { | 108 DEF_TEST(TDStackNester, reporter) { |
| 110 test_stack_nester(reporter); | 109 test_stack_nester(reporter); |
| 111 } | 110 } |
| OLD | NEW |