test.h revision 32af7dbaedf948b4fa22e2c7381f5d34ea51d8db
5b281ba489ca18f0380d7efc7a5108b606cce449vboxsync * IPRT - Testcase Framework.
c0b6af690ad705bddfa87c643b89770a7a0aaf5avboxsync * Copyright (C) 2009 Oracle Corporation
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * available from http://www.virtualbox.org. This file is free software;
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * you can redistribute it and/or modify it under the terms of the GNU
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * General Public License (GPL) as published by the Free Software
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * The contents of this file may alternatively be used under the terms
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * of the Common Development and Distribution License Version 1.0
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * VirtualBox OSE distribution, in which case the provisions of the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * CDDL are applicable instead of those of the GPL.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * You may elect to license modified versions of this file under the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * terms and conditions of either the GPL or the CDDL or both.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync/** @defgroup grp_rt_test RTTest - Testcase Framework.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @ingroup grp_rt
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync/** A test handle. */
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync/** A pointer to a test handle. */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync/** A const pointer to a test handle. */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync/** A NIL Test handle. */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync * Test message importance level.
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync /** Invalid 0. */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync /** Message should always be printed. */
5c1381fc884d30a749517579368ff6cb4b43e809vboxsync /** Failure message. */
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync /** Sub-test banner. */
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync /** Info message. */
2a560b28131ee7efa5b73a9e9cbfdb08eae28624vboxsync /** Debug message. */
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync /** The last (invalid). */
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * Creates a test instance.
0cde281779e97ead3181bbd3b628451fa2b1efe1vboxsync * @returns IPRT status code.
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * @param pszTest The test name.
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsync * @param phTest Where to store the test instance handle.
3fd65c821ad93f378baf8c75b30dcb6a17a5dd77vboxsyncRTR3DECL(int) RTTestCreate(const char *pszTest, PRTTEST phTest);
0cde281779e97ead3181bbd3b628451fa2b1efe1vboxsync * Initializes IPRT and creates a test instance.
0cde281779e97ead3181bbd3b628451fa2b1efe1vboxsync * Typical usage is:
0cde281779e97ead3181bbd3b628451fa2b1efe1vboxsync int main(int argc, char **argv)
0cde281779e97ead3181bbd3b628451fa2b1efe1vboxsync RTTEST hTest;
0cde281779e97ead3181bbd3b628451fa2b1efe1vboxsync int rc = RTTestInitAndCreate("tstSomething", &hTest);
5e5603ae40c7a0a884fe91e269b7d6d6c0ba56f5vboxsync * @returns RTEXITCODE_SUCCESS on success. On failure an error message is
5e5603ae40c7a0a884fe91e269b7d6d6c0ba56f5vboxsync * printed and a suitable exit code is return.
2a560b28131ee7efa5b73a9e9cbfdb08eae28624vboxsync * @param pszTest The test name.
5e5603ae40c7a0a884fe91e269b7d6d6c0ba56f5vboxsync * @param phTest Where to store the test instance handle.
ad27e1d5e48ca41245120c331cc88b50464813cevboxsyncRTR3DECL(RTEXITCODE) RTTestInitAndCreate(const char *pszTest, PRTTEST phTest);
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * Destroys a test instance previously created by RTTestCreate.
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * @returns IPRT status code.
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * @param hTest The test handle. NIL_RTTEST is ignored.
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * Changes the default test instance for the calling thread.
0cde281779e97ead3181bbd3b628451fa2b1efe1vboxsync * @returns IPRT status code.
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * @param hNewDefaultTest The new default test. NIL_RTTEST is fine.
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * @param phOldTest Where to store the old test handle. Optional.
2235e7604f29ce0edc7a1d9aa829668563f86867vboxsyncRTR3DECL(int) RTTestSetDefault(RTTEST hNewDefaultTest, PRTTEST phOldTest);
2235e7604f29ce0edc7a1d9aa829668563f86867vboxsync * Allocate a block of guarded memory.
6a5bc4dc98789eb202e249b189f036e5ff9129ccvboxsync * @returns IPRT status code.
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * associated with the calling thread.
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * @param cb The amount of memory to allocate.
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * @param cbAlign The alignment of the returned block.
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * @param fHead Head or tail optimized guard.
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * @param ppvUser Where to return the pointer to the block.
3c1c973ceaac2fdf7f3b0305f57ae30531acb9ccvboxsyncRTR3DECL(int) RTTestGuardedAlloc(RTTEST hTest, size_t cb, uint32_t cbAlign, bool fHead, void **ppvUser);
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * Allocates a block of guarded memory where the guarded is immediately after
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * the user memory.
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * @returns Pointer to the allocated memory. NULL on failure.
ab7139411cba3600213877c953b69fc11a7ef0cfvboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * associated with the calling thread.
04bce18d27791abed8346aba0de41c53a2acd81avboxsync * @param cb The amount of memory to allocate.
04bce18d27791abed8346aba0de41c53a2acd81avboxsyncRTR3DECL(void *) RTTestGuardedAllocTail(RTTEST hTest, size_t cb);
04bce18d27791abed8346aba0de41c53a2acd81avboxsync * Allocates a block of guarded memory where the guarded is right in front of
6bfca32c67f507f862b751d90d7fa364d3f3844avboxsync * the user memory.
2a560b28131ee7efa5b73a9e9cbfdb08eae28624vboxsync * @returns Pointer to the allocated memory. NULL on failure.
2a560b28131ee7efa5b73a9e9cbfdb08eae28624vboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
2a560b28131ee7efa5b73a9e9cbfdb08eae28624vboxsync * associated with the calling thread.
2a560b28131ee7efa5b73a9e9cbfdb08eae28624vboxsync * @param cb The amount of memory to allocate.
2a560b28131ee7efa5b73a9e9cbfdb08eae28624vboxsyncRTR3DECL(void *) RTTestGuardedAllocHead(RTTEST hTest, size_t cb);
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync * Frees a block of guarded memory.
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync * @returns IPRT status code.
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync * associated with the calling thread.
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync * @param pv The memory. NULL is ignored.
e3e8bde164b5715114ebf596187b5512fa9b75advboxsyncRTR3DECL(int) RTTestGuardedFree(RTTEST hTest, void *pv);
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync * Test vprintf making sure the output starts on a new line.
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync * @returns Number of chars printed.
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync * associated with the calling thread.
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync * @param enmLevel Message importance level.
04bce18d27791abed8346aba0de41c53a2acd81avboxsync * @param pszFormat The message.
04bce18d27791abed8346aba0de41c53a2acd81avboxsync * @param va Arguments.
04bce18d27791abed8346aba0de41c53a2acd81avboxsyncRTR3DECL(int) RTTestPrintfNlV(RTTEST hTest, RTTESTLVL enmLevel, const char *pszFormat, va_list va);
04bce18d27791abed8346aba0de41c53a2acd81avboxsync * Test printf making sure the output starts on a new line.
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync * @returns Number of chars printed.
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync * associated with the calling thread.
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync * @param enmLevel Message importance level.
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync * @param pszFormat The message.
e3e8bde164b5715114ebf596187b5512fa9b75advboxsync * @param ... Arguments.
e3e8bde164b5715114ebf596187b5512fa9b75advboxsyncRTR3DECL(int) RTTestPrintfNl(RTTEST hTest, RTTESTLVL enmLevel, const char *pszFormat, ...);
1df297ea8319f3f3afddb73e6ea2fd9c7f0e5eb4vboxsync * Test vprintf, makes sure lines are prefixed and so forth.
5a7d67754026bd3654a2464799f0db1790ecf183vboxsync * @returns Number of chars printed.
5a7d67754026bd3654a2464799f0db1790ecf183vboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
5a7d67754026bd3654a2464799f0db1790ecf183vboxsync * associated with the calling thread.
5a7d67754026bd3654a2464799f0db1790ecf183vboxsync * @param enmLevel Message importance level.
1df297ea8319f3f3afddb73e6ea2fd9c7f0e5eb4vboxsync * @param pszFormat The message.
1df297ea8319f3f3afddb73e6ea2fd9c7f0e5eb4vboxsync * @param va Arguments.
1df297ea8319f3f3afddb73e6ea2fd9c7f0e5eb4vboxsyncRTR3DECL(int) RTTestPrintfV(RTTEST hTest, RTTESTLVL enmLevel, const char *pszFormat, va_list va);
5a7d67754026bd3654a2464799f0db1790ecf183vboxsync * Test printf, makes sure lines are prefixed and so forth.
5a7d67754026bd3654a2464799f0db1790ecf183vboxsync * @returns Number of chars printed.
5a7d67754026bd3654a2464799f0db1790ecf183vboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
5a7d67754026bd3654a2464799f0db1790ecf183vboxsync * associated with the calling thread.
1df297ea8319f3f3afddb73e6ea2fd9c7f0e5eb4vboxsync * @param enmLevel Message importance level.
1df297ea8319f3f3afddb73e6ea2fd9c7f0e5eb4vboxsync * @param pszFormat The message.
1df297ea8319f3f3afddb73e6ea2fd9c7f0e5eb4vboxsync * @param ... Arguments.
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsyncRTR3DECL(int) RTTestPrintf(RTTEST hTest, RTTESTLVL enmLevel, const char *pszFormat, ...);
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync * Prints the test banner.
ac76755aa3b8483a71b7e52674eaf3432cbda053vboxsync * @returns Number of chars printed.
ac76755aa3b8483a71b7e52674eaf3432cbda053vboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
c00fd08041e14ed8ad7733165f855bfbbc818a0evboxsync * associated with the calling thread.
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * Summaries the test, destroys the test instance and return an exit code.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @returns Test program exit code.
d9658602103599d13b5449fc1ea49d765a23e6f1vboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
d9658602103599d13b5449fc1ea49d765a23e6f1vboxsync * associated with the calling thread.
d9658602103599d13b5449fc1ea49d765a23e6f1vboxsyncRTR3DECL(RTEXITCODE) RTTestSummaryAndDestroy(RTTEST hTest);
d9658602103599d13b5449fc1ea49d765a23e6f1vboxsync * Skips the test, destroys the test instance and return an exit code.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @returns Test program exit code.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * associated with the calling thread.
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * @param pszReasonFmt Text explaining why, optional (NULL).
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @param va Arguments for the reason format string.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsyncRTR3DECL(RTEXITCODE) RTTestSkipAndDestroyV(RTTEST hTest, const char *pszReasonFmt, va_list va);
e0dec59adb362e8486c0622785420ad10e720972vboxsync * Skips the test, destroys the test instance and return an exit code.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @returns Test program exit code.
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync * associated with the calling thread.
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync * @param pszReasonFmt Text explaining why, optional (NULL).
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync * @param ... Arguments for the reason format string.
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsyncRTR3DECL(RTEXITCODE) RTTestSkipAndDestroy(RTTEST hTest, const char *pszReasonFmt, ...);
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync * Starts a sub-test.
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync * This will perform an implicit RTTestSubDone() call if that has not been done
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync * since the last RTTestSub call.
c0b6af690ad705bddfa87c643b89770a7a0aaf5avboxsync * @returns Number of chars printed.
c0b6af690ad705bddfa87c643b89770a7a0aaf5avboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
c0b6af690ad705bddfa87c643b89770a7a0aaf5avboxsync * associated with the calling thread.
c0b6af690ad705bddfa87c643b89770a7a0aaf5avboxsync * @param pszSubTest The sub-test name.
c0b6af690ad705bddfa87c643b89770a7a0aaf5avboxsyncRTR3DECL(int) RTTestSub(RTTEST hTest, const char *pszSubTest);
c0b6af690ad705bddfa87c643b89770a7a0aaf5avboxsync * Format string version of RTTestSub.
c0b6af690ad705bddfa87c643b89770a7a0aaf5avboxsync * See RTTestSub for details.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @returns Number of chars printed.
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * associated with the calling thread.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @param pszSubTestFmt The sub-test name format string.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @param ... Arguments.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsyncRTR3DECL(int) RTTestSubF(RTTEST hTest, const char *pszSubTestFmt, ...);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * Format string version of RTTestSub.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * See RTTestSub for details.
e0dec59adb362e8486c0622785420ad10e720972vboxsync * @returns Number of chars printed.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * associated with the calling thread.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @param pszSubTestFmt The sub-test name format string.
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * @param va Arguments.
fa86ccda70bc5dd1ae28597340f252b212dcf36dvboxsyncRTR3DECL(int) RTTestSubV(RTTEST hTest, const char *pszSubTestFmt, va_list va);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * Completes a sub-test.
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * @returns Number of chars printed.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * associated with the calling thread.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * Prints an extended PASSED message, optional.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * This does not conclude the sub-test, it could be used to report the passing
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * of a sub-sub-to-the-power-of-N-test.
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * @returns IPRT status code.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * associated with the calling thread.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @param pszFormat The message. No trailing newline.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @param va The arguments.
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsyncRTR3DECL(int) RTTestPassedV(RTTEST hTest, const char *pszFormat, va_list va);
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * Prints an extended PASSED message, optional.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * This does not conclude the sub-test, it could be used to report the passing
e0dec59adb362e8486c0622785420ad10e720972vboxsync * of a sub-sub-to-the-power-of-N-test.
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync * @returns IPRT status code.
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync * associated with the calling thread.
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync * @param pszFormat The message. No trailing newline.
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync * @param ... The arguments.
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsyncRTR3DECL(int) RTTestPassed(RTTEST hTest, const char *pszFormat, ...);
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync * Value units.
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync /** The usual invalid value. */
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync /** Percentage (10^-2). */
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync /** Bytes. */
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync /** Bytes per second. */
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync /** Kilobytes. */
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync /** Kilobytes per second. */
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync /** Megabytes. */
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync /** Megabytes per second. */
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync /** Packets. */
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync /** Packets per second. */
4ba3599814cc63307fe48a5d47394ae7c6f391e6vboxsync /** Frames. */
1d8f69ceb39fecbf9a7c95dbac083f3ce5c4efd9vboxsync /** Frames per second. */
1d8f69ceb39fecbf9a7c95dbac083f3ce5c4efd9vboxsync /** Occurrences. */
1d8f69ceb39fecbf9a7c95dbac083f3ce5c4efd9vboxsync /** Occurrences per second. */
1d8f69ceb39fecbf9a7c95dbac083f3ce5c4efd9vboxsync /** Calls. */
1d8f69ceb39fecbf9a7c95dbac083f3ce5c4efd9vboxsync /** Calls per second. */
1d8f69ceb39fecbf9a7c95dbac083f3ce5c4efd9vboxsync /** Round trips. */
1d8f69ceb39fecbf9a7c95dbac083f3ce5c4efd9vboxsync /** Seconds. */
1d8f69ceb39fecbf9a7c95dbac083f3ce5c4efd9vboxsync /** Milliseconds. */
1d8f69ceb39fecbf9a7c95dbac083f3ce5c4efd9vboxsync /** Nanoseconds. */
1d8f69ceb39fecbf9a7c95dbac083f3ce5c4efd9vboxsync /** Nanoseconds per call. */
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync /** Nanoseconds per frame. */
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync /** Nanoseconds per occurrence. */
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync /** Nanoseconds per frame. */
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync /** Nanoseconds per round trip. */
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync /** Parts per thousand (10^-3). */
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync /** Parts per ten thousand (10^-4). */
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync /** Parts per million (10^-6). */
9c0a6e4256c062f83da67f49727042ce66272ef6vboxsync /** Parts per billion (10^-9). */
9c0a6e4256c062f83da67f49727042ce66272ef6vboxsync /** The end of valid units. */
a3231a71cbaa971ead3788ec264543941580b513vboxsync * Report a named test result value.
9c0a6e4256c062f83da67f49727042ce66272ef6vboxsync * This is typically used for benchmarking but can be used for other purposes
107145464a0dfa38b6017b2d8a377aa5f4e49605vboxsync * like reporting limits of some implementation. The value gets associated with
107145464a0dfa38b6017b2d8a377aa5f4e49605vboxsync * the current sub test, the name must be unique within the sub test.
9c0a6e4256c062f83da67f49727042ce66272ef6vboxsync * @returns IPRT status code.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * associated with the calling thread.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param pszName The value name.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param u64Value The value.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param enmUnit The value unit.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsyncRTR3DECL(int) RTTestValue(RTTEST hTest, const char *pszName, uint64_t u64Value, RTTESTUNIT enmUnit);
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * Same as RTTestValue, except that the name is now a format string.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @returns IPRT status code.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
34bfec0bd844700e3b769dcfad1a869ca6b8a0d8vboxsync * associated with the calling thread.
34bfec0bd844700e3b769dcfad1a869ca6b8a0d8vboxsync * @param u64Value The value.
34bfec0bd844700e3b769dcfad1a869ca6b8a0d8vboxsync * @param enmUnit The value unit.
34bfec0bd844700e3b769dcfad1a869ca6b8a0d8vboxsync * @param pszNameFmt The value name format string.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param ... String arguments.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsyncRTR3DECL(int) RTTestValueF(RTTEST hTest, uint64_t u64Value, RTTESTUNIT enmUnit, const char *pszNameFmt, ...);
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * Same as RTTestValue, except that the name is now a format string.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @returns IPRT status code.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * associated with the calling thread.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param u64Value The value.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param enmUnit The value unit.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param pszNameFmt The value name format string.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param va_list String arguments.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsyncRTR3DECL(int) RTTestValueV(RTTEST hTest, uint64_t u64Value, RTTESTUNIT enmUnit, const char *pszNameFmt, va_list va);
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * Increments the error counter.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @returns IPRT status code.
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
0aaf889969ebdaba8a310db13adcec8c10174796vboxsync * associated with the calling thread.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * Get the current error count.
590bfe12ce22cd3716448fbb9f4dc51664bfe5e2vboxsync * @returns The error counter, UINT32_MAX if no valid test handle.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @param hTest The test handle. If NIL_RTTEST we'll use the one
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * associated with the calling thread.
do { if (!(expr)) { \
do { if (!(expr)) { \
return (rcRet); \
do { if (!(expr)) { \
if (!(expr)) { \
do { if (!(expr)) { \
do { if (!(expr)) { \
return (rcRet); \
do { if (!(expr)) { \
RTTestFailed((hTest), "line %u: %s: expected %Rrc, got %Rrc", __LINE__, #rcExpr, (rcExpect), rcCheck); \
RTTestFailed((hTest), "line %u: %s: expected %Rrc, got %Rrc", __LINE__, #rcExpr, (rcExpect), rcCheck); \
return (rcRet); \
RTTestFailed((hTest), "line %u: %s: expected %Rrc, got %Rrc", __LINE__, #rcExpr, (rcExpect), rcCheck); \
RTTestFailed((hTest), "line %u: %s: expected %Rrc, got %Rrc", __LINE__, #rcExpr, (rcExpect), rcCheck); \
return (rcRet); \
RTR3DECL(int) RTTestIValueV(uint64_t u64Value, RTTESTUNIT enmUnit, const char *pszNameFmt, va_list va);
do { if (!(expr)) { \
do { if (!(expr)) { \
return (rcRet); \
do { if (!(expr)) { \
if (!(expr)) { \
do { if (!(expr)) { \
do { if (!(expr)) { \
return (rcRet); \
do { if (!(expr)) { \
return (rcRet); \
return (rcRet); \