summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/tests/sandbox/ut-2803.c
blob: bb3ee975df0f3d9acb30c825aae17e06e5d20e59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//#include "bug-2803.h"
#include "unity.h"
//#include "code-2803.h"

#define VERSION 5 //change this to 5 and the test wont fail.


void setUp(void)
{
  
}

void tearDown(void)
{
}

/*
int main( void )
{

	// loop from {0.0} to {1.1000000} stepping by tv_sec by 1 and tv_usec by 100000
	test_loop( 0, 0,   1,  MICROSECONDS,   1,  MICROSECONDS / 10 );

	// test_loop( 0, 0,   5,  MICROSECONDS,   1,  MICROSECONDS / 1000 );
	// test_loop( 0, 0,  -5, -MICROSECONDS,  -1, -MICROSECONDS / 1000 );

	return 0;
}
*/
void test_main( void )
{
	TEST_ASSERT_EQUAL(0, main2());
}

//VERSION defined at the top of the file

void test_XPASS(void)  //expecting fail but passes, should we get an alert about that?
{	
	//TEST_ABORT
	TEST_EXPECT_FAIL();

	if(VERSION < 4 ){	
		TEST_FAIL_MESSAGE("expected to fail");
	}

	else TEST_ASSERT_EQUAL(1,1);
}

void test_XFAIL(void) //expecting fail, and XFAILs
{	

	TEST_EXPECT_FAIL();

	if(VERSION < 4 ){	
		TEST_FAIL_MESSAGE("Expected to fail");
	}

	else TEST_ASSERT_EQUAL(1,2); 
}

void test_XFAIL_WITH_MESSAGE(void) //expecting fail, and XFAILs
{	
	//TEST_ABORT
	TEST_EXPECT_FAIL_MESSAGE("Doesn't work on this OS");

	if(VERSION < 4 ){	
		TEST_FAIL_MESSAGE("Expected to fail");
	}

	else TEST_ASSERT_EQUAL(1,2); 
}

void test_main_incorrect(void){
	TEST_ASSERT_EQUAL(3, main2());
}

void test_ignored(void){
	//TEST_IGNORE();
	TEST_IGNORE_MESSAGE("This test is being ignored!");   
}
OpenPOWER on IntegriCloud