Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
pal/Test/Unity/test/testdata/mocksample.c@0:06ee5f8a484a, 2017-03-18 (annotated)
- Committer:
- djmeyers
- Date:
- Sat Mar 18 22:37:16 2017 +0000
- Revision:
- 0:06ee5f8a484a
Initial commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| djmeyers | 0:06ee5f8a484a | 1 | // This is just a sample test file to be used to test the generator script |
| djmeyers | 0:06ee5f8a484a | 2 | #ifndef TEST_SAMPLE_H |
| djmeyers | 0:06ee5f8a484a | 3 | #define TEST_SAMPLE_H |
| djmeyers | 0:06ee5f8a484a | 4 | |
| djmeyers | 0:06ee5f8a484a | 5 | #include <setjmp.h> |
| djmeyers | 0:06ee5f8a484a | 6 | #include "unity.h" |
| djmeyers | 0:06ee5f8a484a | 7 | #include "funky.h" |
| djmeyers | 0:06ee5f8a484a | 8 | #include "Mockstanky.h" |
| djmeyers | 0:06ee5f8a484a | 9 | |
| djmeyers | 0:06ee5f8a484a | 10 | void setUp(void) |
| djmeyers | 0:06ee5f8a484a | 11 | { |
| djmeyers | 0:06ee5f8a484a | 12 | CustomSetupStuff(); |
| djmeyers | 0:06ee5f8a484a | 13 | } |
| djmeyers | 0:06ee5f8a484a | 14 | |
| djmeyers | 0:06ee5f8a484a | 15 | void tearDown(void) |
| djmeyers | 0:06ee5f8a484a | 16 | { |
| djmeyers | 0:06ee5f8a484a | 17 | CustomTeardownStuff |
| djmeyers | 0:06ee5f8a484a | 18 | } |
| djmeyers | 0:06ee5f8a484a | 19 | |
| djmeyers | 0:06ee5f8a484a | 20 | //Yup, nice comment |
| djmeyers | 0:06ee5f8a484a | 21 | void test_TheFirstThingToTest(void) |
| djmeyers | 0:06ee5f8a484a | 22 | { |
| djmeyers | 0:06ee5f8a484a | 23 | TEST_ASSERT(1); |
| djmeyers | 0:06ee5f8a484a | 24 | |
| djmeyers | 0:06ee5f8a484a | 25 | TEST_ASSERT_TRUE(1); |
| djmeyers | 0:06ee5f8a484a | 26 | } |
| djmeyers | 0:06ee5f8a484a | 27 | |
| djmeyers | 0:06ee5f8a484a | 28 | /* |
| djmeyers | 0:06ee5f8a484a | 29 | void test_ShouldBeIgnored(void) |
| djmeyers | 0:06ee5f8a484a | 30 | { |
| djmeyers | 0:06ee5f8a484a | 31 | DoesStuff(); |
| djmeyers | 0:06ee5f8a484a | 32 | } |
| djmeyers | 0:06ee5f8a484a | 33 | */ |
| djmeyers | 0:06ee5f8a484a | 34 | |
| djmeyers | 0:06ee5f8a484a | 35 | //void test_ShouldAlsoNotBeTested(void) |
| djmeyers | 0:06ee5f8a484a | 36 | //{ |
| djmeyers | 0:06ee5f8a484a | 37 | // Call_An_Expect(); |
| djmeyers | 0:06ee5f8a484a | 38 | // |
| djmeyers | 0:06ee5f8a484a | 39 | // CallAFunction(); |
| djmeyers | 0:06ee5f8a484a | 40 | // test_CallAFunctionThatLooksLikeATest(); |
| djmeyers | 0:06ee5f8a484a | 41 | //} |
| djmeyers | 0:06ee5f8a484a | 42 | |
| djmeyers | 0:06ee5f8a484a | 43 | void test_TheSecondThingToTest(void) |
| djmeyers | 0:06ee5f8a484a | 44 | { |
| djmeyers | 0:06ee5f8a484a | 45 | Call_An_Expect(); |
| djmeyers | 0:06ee5f8a484a | 46 | |
| djmeyers | 0:06ee5f8a484a | 47 | CallAFunction(); |
| djmeyers | 0:06ee5f8a484a | 48 | test_CallAFunctionThatLooksLikeATest(); |
| djmeyers | 0:06ee5f8a484a | 49 | } |
| djmeyers | 0:06ee5f8a484a | 50 | |
| djmeyers | 0:06ee5f8a484a | 51 | #endif //TEST_SAMPLE_H |