xref: /trunk/main/sal/inc/rtl/tres.h (revision 86e1cf34)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 #ifndef _RTL_TRES_H_
22 #define _RTL_TRES_H_
23 
24 #include <osl/diagnose.h>
25 #include <rtl/string.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31  /* comandline flags */
32 #define rtl_tres_Flag_BOOM      0x00000001
33 #define rtl_tres_Flag_VERBOSE   0x00000002
34 #define rtl_tres_Flag_SKIP      0x00000004
35 #define rtl_tres_Flag_LOG       0x00000010
36 #define rtl_tres_Flag_HIS       0x00000100
37 #define rtl_tres_Flag_TIME      0x00000200
38 #define rtl_tres_Flag_MSG       0x00000400
39 #define rtl_tres_Flag_QUIET     0x00000800
40 
41  /* state flags */
42 #define rtl_tres_Flag_SUB       0x01000000
43 #define rtl_tres_Flag_PASSED    0x10000000
44 #define rtl_tres_Flag_OK        0x20000000
45 
46 
47 
48  /* forward declaration and type definition */
49 struct _rtl_TestResult;
50 typedef struct _rtl_TestResult rtl_TestResult;
51 
52 
53 typedef void* rtl_funcstate;
54 typedef void* rtl_cmpstate;
55 
56  /* type definitions of function pointers which can be overloaded */
57 typedef sal_Bool (SAL_CALL *rtl_tres_state_ptr)(
58                                                 rtl_TestResult*,
59                                                 sal_Bool,
60                                                 const sal_Char*,
61                                                 const sal_Char*,
62                                                 sal_Bool
63                                                 );
64 
65 typedef void (SAL_CALL *rtl_tres_end_ptr)( rtl_TestResult*, const sal_Char* );
66 typedef sal_Bool (SAL_CALL *rtl_tres_ispassed_ptr)( rtl_TestResult* );
67 typedef sal_Bool (SAL_CALL *rtl_tres_isok_ptr)( rtl_TestResult* );
68 typedef rtl_funcstate (SAL_CALL *rtl_tres_funcstate_ptr)( rtl_TestResult* );
69 typedef sal_Bool (SAL_CALL *rtl_tres_isbit_ptr)( rtl_TestResult*,
70                                                                 sal_uInt32 );
71 
72 typedef rtl_funcstate (SAL_CALL *rtl_tres_getnextfuncstate_ptr)
73                                                             ( rtl_funcstate );
74 typedef rtl_funcstate (SAL_CALL *rtl_tres_getprevfuncstate_ptr)
75                                                             ( rtl_funcstate );
76 typedef sal_uInt32 (SAL_CALL *rtl_tres_getflags_ptr)( rtl_funcstate );
77 typedef rtl_String* (SAL_CALL *rtl_tres_getname_ptr)( rtl_funcstate );
78 typedef sal_uInt32 (SAL_CALL *rtl_tres_getstart_ptr)( rtl_funcstate );
79 typedef sal_uInt32 (SAL_CALL *rtl_tres_getstop_ptr)( rtl_funcstate );
80 typedef rtl_cmpstate (SAL_CALL *rtl_tres_getcmpstate_ptr)( rtl_funcstate );
81 
82 typedef sal_Bool (SAL_CALL *rtl_tres_getstat_ptr)( rtl_cmpstate );
83 typedef rtl_String* (SAL_CALL *rtl_tres_getmsg_ptr)( rtl_cmpstate );
84 typedef rtl_cmpstate (SAL_CALL *rtl_tres_getnextcmpstate_ptr)( rtl_cmpstate );
85 
86  /* type definition of vtable structure for testresult */
87 typedef struct _rtl_TestResult_vtable
88 {
89     sal_uInt32                      vtablesize;
90     rtl_tres_state_ptr              state_;
91     rtl_tres_end_ptr                end_;
92     rtl_tres_ispassed_ptr           ispassed;
93     rtl_tres_isok_ptr               isok;
94     rtl_tres_funcstate_ptr          funcstate;
95     rtl_tres_isbit_ptr              isbit;
96     rtl_tres_getnextfuncstate_ptr   nextfuncstate;
97     rtl_tres_getprevfuncstate_ptr   prevfuncstate;
98     rtl_tres_getflags_ptr           flags;
99     rtl_tres_getname_ptr            name;
100     rtl_tres_getstart_ptr           start;
101     rtl_tres_getstop_ptr            stop;
102     rtl_tres_getcmpstate_ptr        cmpstate;
103     rtl_tres_getstat_ptr            stat;
104     rtl_tres_getmsg_ptr             msg;
105     rtl_tres_getnextcmpstate_ptr    nextcmpstate;
106 
107 } rtl_TestResult_vtable;
108 
109  /* type definition of testresult structure */
110 struct _rtl_TestResult
111 {
112     rtl_TestResult_vtable * pFuncs;
113     void *                  pExternalData;
114 
115 };
116 
117 
118  /* exports */
119 rtl_TestResult* SAL_CALL rtl_tres_create( const sal_Char* meth, sal_uInt32 flags );
120 void SAL_CALL rtl_tres_destroy( rtl_TestResult* res );
121 
122 #ifdef __cplusplus
123 }
124 #endif
125 
126 #endif  /* _RTL_TRES_H_ */
127