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