| 1 |
// Copyright (c) Microsoft. All rights reserved. |
| 2 |
// Licensed under the MIT license. See LICENSE file in the project root for full license information. |
| 3 |
|
| 4 |
#include "ctest.h" |
| 5 |
|
| 6 |
static int x = 0; |
| 7 |
static int y = 0; |
| 8 |
|
| 9 |
CTEST_BEGIN_TEST_SUITE(TestFunctionCleanupTests) |
| 10 |
|
| 11 |
CTEST_FUNCTION_INITIALIZE() |
| 12 |
{ |
| 13 |
} |
| 14 |
|
| 15 |
CTEST_FUNCTION_CLEANUP() |
| 16 |
{ |
| 17 |
x++; |
| 18 |
} |
| 19 |
|
| 20 |
CTEST_FUNCTION(Test1) |
| 21 |
{ |
| 22 |
CTEST_ASSERT_ARE_EQUAL(int, y, x); |
| 23 |
y++; |
| 24 |
} |
| 25 |
|
| 26 |
CTEST_FUNCTION(Test2) |
| 27 |
{ |
| 28 |
CTEST_ASSERT_ARE_EQUAL(int, y, x); |
| 29 |
y++; |
| 30 |
} |
| 31 |
|
| 32 |
CTEST_FUNCTION(Test3) |
| 33 |
{ |
| 34 |
CTEST_ASSERT_ARE_EQUAL(int, y, x); |
| 35 |
y++; |
| 36 |
} |
| 37 |
|
| 38 |
CTEST_END_TEST_SUITE(TestFunctionCleanupTests) |