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/testsample.c@0:a2cb7295a1f7, 2017-05-14 (annotated)
- Committer:
- ram54288
- Date:
- Sun May 14 18:35:07 2017 +0000
- Revision:
- 0:a2cb7295a1f7
Initial commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ram54288 | 0:a2cb7295a1f7 | 1 | // This is just a sample test file to be used to test the generator script |
| ram54288 | 0:a2cb7295a1f7 | 2 | #ifndef TEST_SAMPLE_H |
| ram54288 | 0:a2cb7295a1f7 | 3 | #define TEST_SAMPLE_H |
| ram54288 | 0:a2cb7295a1f7 | 4 | |
| ram54288 | 0:a2cb7295a1f7 | 5 | #include <setjmp.h> |
| ram54288 | 0:a2cb7295a1f7 | 6 | #include "unity.h" |
| ram54288 | 0:a2cb7295a1f7 | 7 | #include "funky.h" |
| ram54288 | 0:a2cb7295a1f7 | 8 | #include "stanky.h" |
| ram54288 | 0:a2cb7295a1f7 | 9 | |
| ram54288 | 0:a2cb7295a1f7 | 10 | void setUp(void) |
| ram54288 | 0:a2cb7295a1f7 | 11 | { |
| ram54288 | 0:a2cb7295a1f7 | 12 | CustomSetupStuff(); |
| ram54288 | 0:a2cb7295a1f7 | 13 | } |
| ram54288 | 0:a2cb7295a1f7 | 14 | |
| ram54288 | 0:a2cb7295a1f7 | 15 | void tearDown(void) |
| ram54288 | 0:a2cb7295a1f7 | 16 | { |
| ram54288 | 0:a2cb7295a1f7 | 17 | CustomTeardownStuff |
| ram54288 | 0:a2cb7295a1f7 | 18 | } |
| ram54288 | 0:a2cb7295a1f7 | 19 | |
| ram54288 | 0:a2cb7295a1f7 | 20 | //Yup, nice comment |
| ram54288 | 0:a2cb7295a1f7 | 21 | void test_TheFirstThingToTest(void) |
| ram54288 | 0:a2cb7295a1f7 | 22 | { |
| ram54288 | 0:a2cb7295a1f7 | 23 | TEST_ASSERT(1); |
| ram54288 | 0:a2cb7295a1f7 | 24 | |
| ram54288 | 0:a2cb7295a1f7 | 25 | TEST_ASSERT_TRUE(1); |
| ram54288 | 0:a2cb7295a1f7 | 26 | } |
| ram54288 | 0:a2cb7295a1f7 | 27 | |
| ram54288 | 0:a2cb7295a1f7 | 28 | /* |
| ram54288 | 0:a2cb7295a1f7 | 29 | void test_ShouldBeIgnored(void) |
| ram54288 | 0:a2cb7295a1f7 | 30 | { |
| ram54288 | 0:a2cb7295a1f7 | 31 | DoesStuff(); |
| ram54288 | 0:a2cb7295a1f7 | 32 | } |
| ram54288 | 0:a2cb7295a1f7 | 33 | */ |
| ram54288 | 0:a2cb7295a1f7 | 34 | |
| ram54288 | 0:a2cb7295a1f7 | 35 | //void test_ShouldAlsoNotBeTested(void) |
| ram54288 | 0:a2cb7295a1f7 | 36 | //{ |
| ram54288 | 0:a2cb7295a1f7 | 37 | // Call_An_Expect(); |
| ram54288 | 0:a2cb7295a1f7 | 38 | // |
| ram54288 | 0:a2cb7295a1f7 | 39 | // CallAFunction(); |
| ram54288 | 0:a2cb7295a1f7 | 40 | // test_CallAFunctionThatLooksLikeATest(); |
| ram54288 | 0:a2cb7295a1f7 | 41 | //} |
| ram54288 | 0:a2cb7295a1f7 | 42 | |
| ram54288 | 0:a2cb7295a1f7 | 43 | void test_TheSecondThingToTest(void) |
| ram54288 | 0:a2cb7295a1f7 | 44 | { |
| ram54288 | 0:a2cb7295a1f7 | 45 | uint8_t* crazyString = "GET / HTTP/1.1\r\nHost: 127.0.0.1:8081\r\nConnection: keep-alive\r\nCache-Control: no-cache\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36\r\nPostman-Token: 768c7149-c3fb-f704-71a2-63918d9195b2\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-GB,en-US;q=0.8,en;q=0.6\r\n\r\n"; |
| ram54288 | 0:a2cb7295a1f7 | 46 | |
| ram54288 | 0:a2cb7295a1f7 | 47 | Call_An_Expect(); |
| ram54288 | 0:a2cb7295a1f7 | 48 | |
| ram54288 | 0:a2cb7295a1f7 | 49 | CallAFunction(); |
| ram54288 | 0:a2cb7295a1f7 | 50 | test_CallAFunctionThatLooksLikeATest(); |
| ram54288 | 0:a2cb7295a1f7 | 51 | } |
| ram54288 | 0:a2cb7295a1f7 | 52 | |
| ram54288 | 0:a2cb7295a1f7 | 53 | void test_TheThirdThingToTest(void) |
| ram54288 | 0:a2cb7295a1f7 | 54 | { |
| ram54288 | 0:a2cb7295a1f7 | 55 | CallAFunction(); |
| ram54288 | 0:a2cb7295a1f7 | 56 | } |
| ram54288 | 0:a2cb7295a1f7 | 57 | |
| ram54288 | 0:a2cb7295a1f7 | 58 | void test_TheFourthThingToTest(void) |
| ram54288 | 0:a2cb7295a1f7 | 59 | { |
| ram54288 | 0:a2cb7295a1f7 | 60 | uint8_t* anotherString = "GET / HTTP/1.1\r\nHost: 127.0.0.1:8081\r\nConnection: keep-alive\r\nCache-Control: no-cache\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36\r\nPostman-Token: 768c7149-c3fb-f704-71a2-63918d9195b2\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-GB,en-US;q=0.8,en;q=0.6\r\n\r\n"; |
| ram54288 | 0:a2cb7295a1f7 | 61 | |
| ram54288 | 0:a2cb7295a1f7 | 62 | Call_An_Expect(); |
| ram54288 | 0:a2cb7295a1f7 | 63 | |
| ram54288 | 0:a2cb7295a1f7 | 64 | CallAFunction(); |
| ram54288 | 0:a2cb7295a1f7 | 65 | test_CallAFunctionThatLooksLikeATest(); |
| ram54288 | 0:a2cb7295a1f7 | 66 | } |
| ram54288 | 0:a2cb7295a1f7 | 67 | |
| ram54288 | 0:a2cb7295a1f7 | 68 | #endif //TEST_SAMPLE_H |