1 //#include "bug-2803.h"
2 #include "unity.h"
3 //#include "code-2803.h"
4
5 #define VERSION 5 //change this to 5 and the test wont fail.
6
7
setUp(void)8 void setUp(void)
9 {
10
11 }
12
tearDown(void)13 void tearDown(void)
14 {
15 }
16
17 /*
18 int main( void )
19 {
20
21 // loop from {0.0} to {1.1000000} stepping by tv_sec by 1 and tv_usec by 100000
22 test_loop( 0, 0, 1, MICROSECONDS, 1, MICROSECONDS / 10 );
23
24 // test_loop( 0, 0, 5, MICROSECONDS, 1, MICROSECONDS / 1000 );
25 // test_loop( 0, 0, -5, -MICROSECONDS, -1, -MICROSECONDS / 1000 );
26
27 return 0;
28 }
29 */
test_main(void)30 void test_main( void )
31 {
32 TEST_ASSERT_EQUAL(0, main2());
33 }
34
35 //VERSION defined at the top of the file
36
test_XPASS(void)37 void test_XPASS(void) //expecting fail but passes, should we get an alert about that?
38 {
39 //TEST_ABORT
40 TEST_EXPECT_FAIL();
41
42 if(VERSION < 4 ){
43 TEST_FAIL_MESSAGE("expected to fail");
44 }
45
46 else TEST_ASSERT_EQUAL(1,1);
47 }
48
test_XFAIL(void)49 void test_XFAIL(void) //expecting fail, and XFAILs
50 {
51
52 TEST_EXPECT_FAIL();
53
54 if(VERSION < 4 ){
55 TEST_FAIL_MESSAGE("Expected to fail");
56 }
57
58 else TEST_ASSERT_EQUAL(1,2);
59 }
60
test_XFAIL_WITH_MESSAGE(void)61 void test_XFAIL_WITH_MESSAGE(void) //expecting fail, and XFAILs
62 {
63 //TEST_ABORT
64 TEST_EXPECT_FAIL_MESSAGE("Doesn't work on this OS");
65
66 if(VERSION < 4 ){
67 TEST_FAIL_MESSAGE("Expected to fail");
68 }
69
70 else TEST_ASSERT_EQUAL(1,2);
71 }
72
test_main_incorrect(void)73 void test_main_incorrect(void){
74 TEST_ASSERT_EQUAL(3, main2());
75 }
76
test_ignored(void)77 void test_ignored(void){
78 //TEST_IGNORE();
79 TEST_IGNORE_MESSAGE("This test is being ignored!");
80 }
81