xref: /aoo42x/main/sal/inc/rtl/tres.h (revision cdf0e10c)
1*cdf0e10cSrcweir #ifndef _RTL_TRES_H_
2*cdf0e10cSrcweir #define _RTL_TRES_H_
3*cdf0e10cSrcweir 
4*cdf0e10cSrcweir #include <osl/diagnose.h>
5*cdf0e10cSrcweir #include <rtl/string.h>
6*cdf0e10cSrcweir 
7*cdf0e10cSrcweir #ifdef __cplusplus
8*cdf0e10cSrcweir extern "C" {
9*cdf0e10cSrcweir #endif
10*cdf0e10cSrcweir 
11*cdf0e10cSrcweir  /* comandline flags */
12*cdf0e10cSrcweir #define rtl_tres_Flag_BOOM      0x00000001
13*cdf0e10cSrcweir #define rtl_tres_Flag_VERBOSE   0x00000002
14*cdf0e10cSrcweir #define rtl_tres_Flag_SKIP      0x00000004
15*cdf0e10cSrcweir #define rtl_tres_Flag_LOG       0x00000010
16*cdf0e10cSrcweir #define rtl_tres_Flag_HIS       0x00000100
17*cdf0e10cSrcweir #define rtl_tres_Flag_TIME      0x00000200
18*cdf0e10cSrcweir #define rtl_tres_Flag_MSG       0x00000400
19*cdf0e10cSrcweir #define rtl_tres_Flag_QUIET     0x00000800
20*cdf0e10cSrcweir 
21*cdf0e10cSrcweir  /* state flags */
22*cdf0e10cSrcweir #define rtl_tres_Flag_SUB       0x01000000
23*cdf0e10cSrcweir #define rtl_tres_Flag_PASSED    0x10000000
24*cdf0e10cSrcweir #define rtl_tres_Flag_OK        0x20000000
25*cdf0e10cSrcweir 
26*cdf0e10cSrcweir 
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir  /* forward declaration and type definition */
29*cdf0e10cSrcweir struct _rtl_TestResult;
30*cdf0e10cSrcweir typedef struct _rtl_TestResult rtl_TestResult;
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir typedef void* rtl_funcstate;
34*cdf0e10cSrcweir typedef void* rtl_cmpstate;
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir  /* type definitions of function pointers wich can be overloaded */
37*cdf0e10cSrcweir typedef sal_Bool (SAL_CALL *rtl_tres_state_ptr)(
38*cdf0e10cSrcweir                                                 rtl_TestResult*,
39*cdf0e10cSrcweir                                                 sal_Bool,
40*cdf0e10cSrcweir                                                 const sal_Char*,
41*cdf0e10cSrcweir                                                 const sal_Char*,
42*cdf0e10cSrcweir                                                 sal_Bool
43*cdf0e10cSrcweir                                                 );
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir typedef void (SAL_CALL *rtl_tres_end_ptr)( rtl_TestResult*, const sal_Char* );
46*cdf0e10cSrcweir typedef sal_Bool (SAL_CALL *rtl_tres_ispassed_ptr)( rtl_TestResult* );
47*cdf0e10cSrcweir typedef sal_Bool (SAL_CALL *rtl_tres_isok_ptr)( rtl_TestResult* );
48*cdf0e10cSrcweir typedef rtl_funcstate (SAL_CALL *rtl_tres_funcstate_ptr)( rtl_TestResult* );
49*cdf0e10cSrcweir typedef sal_Bool (SAL_CALL *rtl_tres_isbit_ptr)( rtl_TestResult*,
50*cdf0e10cSrcweir                                                                 sal_uInt32 );
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir typedef rtl_funcstate (SAL_CALL *rtl_tres_getnextfuncstate_ptr)
53*cdf0e10cSrcweir                                                             ( rtl_funcstate );
54*cdf0e10cSrcweir typedef rtl_funcstate (SAL_CALL *rtl_tres_getprevfuncstate_ptr)
55*cdf0e10cSrcweir                                                             ( rtl_funcstate );
56*cdf0e10cSrcweir typedef sal_uInt32 (SAL_CALL *rtl_tres_getflags_ptr)( rtl_funcstate );
57*cdf0e10cSrcweir typedef rtl_String* (SAL_CALL *rtl_tres_getname_ptr)( rtl_funcstate );
58*cdf0e10cSrcweir typedef sal_uInt32 (SAL_CALL *rtl_tres_getstart_ptr)( rtl_funcstate );
59*cdf0e10cSrcweir typedef sal_uInt32 (SAL_CALL *rtl_tres_getstop_ptr)( rtl_funcstate );
60*cdf0e10cSrcweir typedef rtl_cmpstate (SAL_CALL *rtl_tres_getcmpstate_ptr)( rtl_funcstate );
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir typedef sal_Bool (SAL_CALL *rtl_tres_getstat_ptr)( rtl_cmpstate );
63*cdf0e10cSrcweir typedef rtl_String* (SAL_CALL *rtl_tres_getmsg_ptr)( rtl_cmpstate );
64*cdf0e10cSrcweir typedef rtl_cmpstate (SAL_CALL *rtl_tres_getnextcmpstate_ptr)( rtl_cmpstate );
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir  /* type definition of vtable structure for testresult */
67*cdf0e10cSrcweir typedef struct _rtl_TestResult_vtable
68*cdf0e10cSrcweir {
69*cdf0e10cSrcweir     sal_uInt32                      vtablesize;
70*cdf0e10cSrcweir     rtl_tres_state_ptr              state_;
71*cdf0e10cSrcweir     rtl_tres_end_ptr                end_;
72*cdf0e10cSrcweir     rtl_tres_ispassed_ptr           ispassed;
73*cdf0e10cSrcweir     rtl_tres_isok_ptr               isok;
74*cdf0e10cSrcweir     rtl_tres_funcstate_ptr          funcstate;
75*cdf0e10cSrcweir     rtl_tres_isbit_ptr              isbit;
76*cdf0e10cSrcweir     rtl_tres_getnextfuncstate_ptr   nextfuncstate;
77*cdf0e10cSrcweir     rtl_tres_getprevfuncstate_ptr   prevfuncstate;
78*cdf0e10cSrcweir     rtl_tres_getflags_ptr           flags;
79*cdf0e10cSrcweir     rtl_tres_getname_ptr            name;
80*cdf0e10cSrcweir     rtl_tres_getstart_ptr           start;
81*cdf0e10cSrcweir     rtl_tres_getstop_ptr            stop;
82*cdf0e10cSrcweir     rtl_tres_getcmpstate_ptr        cmpstate;
83*cdf0e10cSrcweir     rtl_tres_getstat_ptr            stat;
84*cdf0e10cSrcweir     rtl_tres_getmsg_ptr             msg;
85*cdf0e10cSrcweir     rtl_tres_getnextcmpstate_ptr    nextcmpstate;
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir } rtl_TestResult_vtable;
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir  /* type definition of testresult structure */
90*cdf0e10cSrcweir struct _rtl_TestResult
91*cdf0e10cSrcweir {
92*cdf0e10cSrcweir     rtl_TestResult_vtable * pFuncs;
93*cdf0e10cSrcweir     void *                  pExternalData;
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir };
96*cdf0e10cSrcweir 
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir  /* exports */
99*cdf0e10cSrcweir rtl_TestResult* SAL_CALL rtl_tres_create( const sal_Char* meth, sal_uInt32 flags );
100*cdf0e10cSrcweir void SAL_CALL rtl_tres_destroy( rtl_TestResult* res );
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir #ifdef __cplusplus
103*cdf0e10cSrcweir }
104*cdf0e10cSrcweir #endif
105*cdf0e10cSrcweir 
106*cdf0e10cSrcweir #endif  /* _RTL_TRES_H_ */
107