1 | /* $Id: testi.cpp 93115 2022-01-01 11:31:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * IPRT - Testcase Framework, the implicit test handle API variation.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2009-2022 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * The contents of this file may alternatively be used under the terms
|
---|
18 | * of the Common Development and Distribution License Version 1.0
|
---|
19 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | * CDDL are applicable instead of those of the GPL.
|
---|
22 | *
|
---|
23 | * You may elect to license modified versions of this file under the
|
---|
24 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | */
|
---|
26 |
|
---|
27 |
|
---|
28 | /*********************************************************************************************************************************
|
---|
29 | * Header Files *
|
---|
30 | *********************************************************************************************************************************/
|
---|
31 | #include <iprt/test.h>
|
---|
32 | #include <iprt/stdarg.h>
|
---|
33 |
|
---|
34 |
|
---|
35 | RTR3DECL(int) RTTestIPrintfV(RTTESTLVL enmLevel, const char *pszFormat, va_list va)
|
---|
36 | {
|
---|
37 | return RTTestPrintfV(NIL_RTTEST, enmLevel, pszFormat, va);
|
---|
38 | }
|
---|
39 |
|
---|
40 |
|
---|
41 | RTR3DECL(int) RTTestIPrintf(RTTESTLVL enmLevel, const char *pszFormat, ...)
|
---|
42 | {
|
---|
43 | va_list va;
|
---|
44 | va_start(va, pszFormat);
|
---|
45 | int cch = RTTestPrintfV(NIL_RTTEST, enmLevel, pszFormat, va);
|
---|
46 | va_end(va);
|
---|
47 | return cch;
|
---|
48 | }
|
---|
49 |
|
---|
50 |
|
---|
51 | RTR3DECL(int) RTTestISub(const char *pszSubTest)
|
---|
52 | {
|
---|
53 | return RTTestSub(NIL_RTTEST, pszSubTest);
|
---|
54 | }
|
---|
55 |
|
---|
56 |
|
---|
57 | RTR3DECL(int) RTTestISubF(const char *pszSubTestFmt, ...)
|
---|
58 | {
|
---|
59 | va_list va;
|
---|
60 | va_start(va, pszSubTestFmt);
|
---|
61 | int cch = RTTestSubV(NIL_RTTEST, pszSubTestFmt, va);
|
---|
62 | va_end(va);
|
---|
63 | return cch;
|
---|
64 | }
|
---|
65 |
|
---|
66 |
|
---|
67 | RTR3DECL(int) RTTestISubV(const char *pszSubTestFmt, va_list va)
|
---|
68 | {
|
---|
69 | return RTTestSubV(NIL_RTTEST, pszSubTestFmt, va);
|
---|
70 | }
|
---|
71 |
|
---|
72 |
|
---|
73 | RTR3DECL(int) RTTestISubDone(void)
|
---|
74 | {
|
---|
75 | return RTTestSubDone(NIL_RTTEST);
|
---|
76 | }
|
---|
77 |
|
---|
78 |
|
---|
79 | RTR3DECL(int) RTTestIPassedV(const char *pszFormat, va_list va)
|
---|
80 | {
|
---|
81 | return RTTestPassedV(NIL_RTTEST, pszFormat, va);
|
---|
82 | }
|
---|
83 |
|
---|
84 |
|
---|
85 | RTR3DECL(int) RTTestIPassed(const char *pszFormat, ...)
|
---|
86 | {
|
---|
87 | va_list va;
|
---|
88 | va_start(va, pszFormat);
|
---|
89 | int cch = RTTestPassedV(NIL_RTTEST, pszFormat, va);
|
---|
90 | va_end(va);
|
---|
91 | return cch;
|
---|
92 | }
|
---|
93 |
|
---|
94 |
|
---|
95 | RTR3DECL(int) RTTestIValue(const char *pszName, uint64_t u64Value, RTTESTUNIT enmUnit)
|
---|
96 | {
|
---|
97 | return RTTestValue(NIL_RTTEST, pszName, u64Value, enmUnit);
|
---|
98 | }
|
---|
99 |
|
---|
100 |
|
---|
101 | RTR3DECL(int) RTTestIValueF(uint64_t u64Value, RTTESTUNIT enmUnit, const char *pszNameFmt, ...)
|
---|
102 | {
|
---|
103 | va_list va;
|
---|
104 | va_start(va, pszNameFmt);
|
---|
105 | int rc = RTTestValueV(NIL_RTTEST, u64Value, enmUnit, pszNameFmt, va);
|
---|
106 | va_end(va);
|
---|
107 | return rc;
|
---|
108 | }
|
---|
109 |
|
---|
110 |
|
---|
111 | RTR3DECL(int) RTTestIValueV(uint64_t u64Value, RTTESTUNIT enmUnit, const char *pszNameFmt, va_list va)
|
---|
112 | {
|
---|
113 | return RTTestValueV(NIL_RTTEST, u64Value, enmUnit, pszNameFmt, va);
|
---|
114 | }
|
---|
115 |
|
---|
116 |
|
---|
117 | RTR3DECL(int) RTTestIErrorInc(void)
|
---|
118 | {
|
---|
119 | return RTTestErrorInc(NIL_RTTEST);
|
---|
120 | }
|
---|
121 |
|
---|
122 |
|
---|
123 | RTR3DECL(uint32_t) RTTestIErrorCount(void)
|
---|
124 | {
|
---|
125 | return RTTestErrorCount(NIL_RTTEST);
|
---|
126 | }
|
---|
127 |
|
---|
128 |
|
---|
129 | RTR3DECL(int) RTTestIFailedV(const char *pszFormat, va_list va)
|
---|
130 | {
|
---|
131 | return RTTestFailedV(NIL_RTTEST, pszFormat, va);
|
---|
132 | }
|
---|
133 |
|
---|
134 |
|
---|
135 | RTR3DECL(int) RTTestIFailed(const char *pszFormat, ...)
|
---|
136 | {
|
---|
137 | va_list va;
|
---|
138 | va_start(va, pszFormat);
|
---|
139 | int cch = RTTestFailedV(NIL_RTTEST, pszFormat, va);
|
---|
140 | va_end(va);
|
---|
141 | return cch;
|
---|
142 | }
|
---|
143 |
|
---|
144 |
|
---|
145 | RTR3DECL(int) RTTestIFailedRcV(int rcRet, const char *pszFormat, va_list va)
|
---|
146 | {
|
---|
147 | RTTestFailedV(NIL_RTTEST, pszFormat, va);
|
---|
148 | return rcRet;
|
---|
149 | }
|
---|
150 |
|
---|
151 |
|
---|
152 | RTR3DECL(int) RTTestIFailedRc(int rcRet, const char *pszFormat, ...)
|
---|
153 | {
|
---|
154 | va_list va;
|
---|
155 | va_start(va, pszFormat);
|
---|
156 | RTTestFailedV(NIL_RTTEST, pszFormat, va);
|
---|
157 | va_end(va);
|
---|
158 | return rcRet;
|
---|
159 | }
|
---|
160 |
|
---|
161 |
|
---|
162 | RTR3DECL(int) RTTestIFailureDetailsV(const char *pszFormat, va_list va)
|
---|
163 | {
|
---|
164 | return RTTestFailureDetails(NIL_RTTEST, pszFormat, va);
|
---|
165 | }
|
---|
166 |
|
---|
167 |
|
---|
168 | RTR3DECL(int) RTTestIFailureDetails(const char *pszFormat, ...)
|
---|
169 | {
|
---|
170 | va_list va;
|
---|
171 | va_start(va, pszFormat);
|
---|
172 | int cch = RTTestFailureDetailsV(NIL_RTTEST, pszFormat, va);
|
---|
173 | va_end(va);
|
---|
174 | return cch;
|
---|
175 | }
|
---|
176 |
|
---|
177 |
|
---|
178 | RTR3DECL(int) RTTestIErrContextV(const char *pszFormat, va_list va)
|
---|
179 | {
|
---|
180 | return RTTestErrContextV(NIL_RTTEST, pszFormat, va);
|
---|
181 | }
|
---|
182 |
|
---|
183 |
|
---|
184 | RTR3DECL(int) RTTestErrContext(const char *pszFormat, ...)
|
---|
185 | {
|
---|
186 | va_list va;
|
---|
187 | va_start(va, pszFormat);
|
---|
188 | int rc = RTTestIErrContextV(pszFormat, va);
|
---|
189 | va_end(va);
|
---|
190 | return rc;
|
---|
191 | }
|
---|
192 |
|
---|
193 |
|
---|
194 | RTR3DECL(int) RTTestIDisableAssertions(void)
|
---|
195 | {
|
---|
196 | return RTTestDisableAssertions(NIL_RTTEST);
|
---|
197 | }
|
---|
198 |
|
---|
199 |
|
---|
200 | RTR3DECL(int) RTTestIRestoreAssertions(void)
|
---|
201 | {
|
---|
202 | return RTTestRestoreAssertions(NIL_RTTEST);
|
---|
203 | }
|
---|
204 |
|
---|