1 | /* $Id: tstLog.cpp 1 1970-01-01 00:00:00Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * InnoTek Portable Runtime Testcase - Log Formatting.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006 InnoTek Systemberatung GmbH
|
---|
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 as published by the Free Software Foundation,
|
---|
13 | * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
14 | * distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
15 | * be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * If you received this file as part of a commercial VirtualBox
|
---|
18 | * distribution, then only the terms of your commercial VirtualBox
|
---|
19 | * license agreement apply instead of the previous paragraph.
|
---|
20 | */
|
---|
21 |
|
---|
22 | /*******************************************************************************
|
---|
23 | * Header Files *
|
---|
24 | *******************************************************************************/
|
---|
25 | #include <iprt/log.h>
|
---|
26 | #include <iprt/runtime.h>
|
---|
27 | #include <iprt/err.h>
|
---|
28 |
|
---|
29 | #include <stdio.h>
|
---|
30 |
|
---|
31 | int main()
|
---|
32 | {
|
---|
33 | RTR3Init();
|
---|
34 | printf("tstLog: Requires manual inspection of the log output!\n");
|
---|
35 | RTLogPrintf("%%Vrc %d: %Vrc\n", VERR_INVALID_PARAMETER, VERR_INVALID_PARAMETER);
|
---|
36 | RTLogPrintf("%%Vrs %d: %Vrs\n", VERR_INVALID_PARAMETER, VERR_INVALID_PARAMETER);
|
---|
37 | RTLogPrintf("%%Vrf %d: %Vrf\n", VERR_INVALID_PARAMETER, VERR_INVALID_PARAMETER);
|
---|
38 | RTLogPrintf("%%Vra %d: %Vra\n", VERR_INVALID_PARAMETER, VERR_INVALID_PARAMETER);
|
---|
39 |
|
---|
40 | RTLogPrintf("%%Vt: %Vt\n");
|
---|
41 |
|
---|
42 | static uint8_t au8Hex[256];
|
---|
43 | for (unsigned iHex = 0; iHex < sizeof(au8Hex); iHex++)
|
---|
44 | au8Hex[iHex] = (uint8_t)iHex;
|
---|
45 | RTLogPrintf("%%Vhxs : %Vhxs\n", &au8Hex[0]);
|
---|
46 | RTLogPrintf("%%.32Vhxs: %.32Vhxs\n", &au8Hex[0]);
|
---|
47 |
|
---|
48 | RTLogPrintf("%%Vhxd :\n%Vhxd\n", &au8Hex[0]);
|
---|
49 | RTLogPrintf("%%.64Vhxd:\n%.64Vhxd\n", &au8Hex[0]);
|
---|
50 | RTLogPrintf("%%.*Vhxd:\n%.*Vhxd\n", 64, &au8Hex[0]);
|
---|
51 | RTLogPrintf("%%32.256Vhxd : \n%32.256Vhxd\n", &au8Hex[0]);
|
---|
52 | RTLogPrintf("%%32.*Vhxd : \n%32.*Vhxd\n", 256, &au8Hex[0]);
|
---|
53 | RTLogPrintf("%%7.32Vhxd : \n%7.32Vhxd\n", &au8Hex[0]);
|
---|
54 | RTLogPrintf("%%7.*Vhxd : \n%7.*Vhxd\n", 32, &au8Hex[0]);
|
---|
55 | RTLogPrintf("%%*.*Vhxd : \n%*.*Vhxd\n", 7, 32, &au8Hex[0]);
|
---|
56 |
|
---|
57 | RTLogPrintf("%%VGp: %VGp\n", (RTGCPHYS)0x87654321);
|
---|
58 | RTLogPrintf("%%VGv: %VGv\n", (RTGCPTR)0x87654321);
|
---|
59 | RTLogPrintf("%%VHp: %VHp\n", (RTGCPHYS)0x87654321);
|
---|
60 | RTLogPrintf("%%VHv: %VHv\n", (RTGCPTR)0x87654321);
|
---|
61 |
|
---|
62 | RTLogPrintf("%%VI8 : %VI8\n", (uint8_t)808);
|
---|
63 | RTLogPrintf("%%VI16: %VI16\n", (uint16_t)16016);
|
---|
64 | RTLogPrintf("%%VI32: %VI32\n", _1G);
|
---|
65 | RTLogPrintf("%%VI64: %VI64\n", _1E);
|
---|
66 |
|
---|
67 | RTLogPrintf("%%VU8 : %VU8\n", (uint8_t)808);
|
---|
68 | RTLogPrintf("%%VU16: %VU16\n", (uint16_t)16016);
|
---|
69 | RTLogPrintf("%%VU32: %VU32\n", _2G32);
|
---|
70 | RTLogPrintf("%%VU64: %VU64\n", _2E);
|
---|
71 |
|
---|
72 | RTLogPrintf("%%VX8 : %VX8 %#VX8\n", (uint8_t)808, (uint8_t)808);
|
---|
73 | RTLogPrintf("%%VX16: %VX16 %#VX16\n", (uint16_t)16016, (uint16_t)16016);
|
---|
74 | RTLogPrintf("%%VX32: %VX32 %#VX32\n", _2G32, _2G32);
|
---|
75 | RTLogPrintf("%%VX64: %VX64 %#VX64\n", _2E, _2E);
|
---|
76 |
|
---|
77 | RTLogFlush(NULL);
|
---|
78 |
|
---|
79 | return 0;
|
---|
80 | }
|
---|
81 |
|
---|