• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * COPYRIGHT AND PERMISSION NOTICE
3  *
4  * Copyright (c) 2003 Embedded Unit Project
5  *
6  * All rights reserved.
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining
9  * a copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, and/or sell copies of the Software, and to permit persons
13  * to whom the Software is furnished to do so, provided that the above
14  * copyright notice(s) and this permission notice appear in all copies
15  * of the Software and that both the above copyright notice(s) and this
16  * permission notice appear in supporting documentation.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
21  * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
22  * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY
23  * SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
24  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
25  * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
26  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
27  *
28  * Except as contained in this notice, the name of a copyright holder
29  * shall not be used in advertising or otherwise to promote the sale,
30  * use or other dealings in this Software without prior written
31  * authorization of the copyright holder.
32  *
33  * $Id: TestCaller.h,v 1.7 2004/02/10 16:19:29 arms22 Exp $
34  */
35 #ifndef	__TESTCALLER_H__
36 #define	__TESTCALLER_H__
37 
38 typedef struct __TestFixture	TestFixture;
39 typedef struct __TestFixture*	TestFixtureRef;/*downward compatible*/
40 
41 struct __TestFixture {
42 	char *name;
43 	void(*test)(void);
44 };
45 
46 #define new_TestFixture(name,test)\
47 	{\
48 		name,\
49 		test,\
50 	}
51 
52 typedef struct __TestCaller		TestCaller;
53 typedef struct __TestCaller*	TestCallerRef;/*downward compatible*/
54 
55 struct __TestCaller {
56 	TestImplement* isa;
57 	char *name;
58 	void(*setUp)(void);
59 	void(*tearDown)(void);
60 	int numberOfFixtuers;
61 	TestFixture	*fixtuers;
62 };
63 
64 extern const TestImplement TestCallerImplement;
65 
66 #define new_TestCaller(name,sup,tdw,numberOfFixtuers,fixtuers)\
67 	{\
68 		(TestImplement*)&TestCallerImplement,\
69 		name,\
70 		sup,\
71 		tdw,\
72 		numberOfFixtuers,\
73 		fixtuers,\
74 	}
75 
76 #endif/*__TESTCALLER_H__*/
77