VirtualBox

source: vbox/trunk/src/VBox/Runtime/r3/testi.cpp@ 98456

Last change on this file since 98456 was 98103, checked in by vboxsync, 2 years ago

Copyright year updates by scm.

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette