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