VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedFolders/testcase/tstShflSizes.cpp@ 3491

Last change on this file since 3491 was 3338, checked in by vboxsync, 18 years ago

Export HostServices

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1/** @file
2 *
3 * Testcase for shared folder structure sizes.
4 * Run this on Linux and Windows, then compare.
5 */
6
7/*
8 * Copyright (C) 2006-2007 innotek GmbH
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License as published by the Free Software Foundation,
14 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
15 * distribution. VirtualBox OSE is distributed in the hope that it will
16 * be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * If you received this file as part of a commercial VirtualBox
19 * distribution, then only the terms of your commercial VirtualBox
20 * license agreement apply instead of the previous paragraph.
21 */
22
23/*******************************************************************************
24* Header Files *
25*******************************************************************************/
26#include <VBox/shflsvc.h>
27#include <iprt/stream.h>
28
29#define STRUCT(t, size) \
30 do { \
31 if (fPrintChecks) \
32 RTPrintf(" STRUCT(" #t ", %d);\n", (int)sizeof(t)); \
33 else if ((size) != sizeof(t)) \
34 { \
35 RTPrintf("%30s: %d expected %d!\n", #t, (int)sizeof(t), (size)); \
36 cErrors++; \
37 } \
38 else \
39 RTPrintf("%30s: %d\n", #t, (int)sizeof(t)); \
40 } while (0)
41
42
43int main(int argc, char **argv)
44{
45 unsigned cErrors = 0;
46
47 /*
48 * Prints the code below if any argument was giving.
49 */
50 bool fPrintChecks = argc != 1;
51
52 /*
53 * The checks.
54 */
55 STRUCT(SHFLROOT, 4);
56 STRUCT(SHFLHANDLE, 8);
57 STRUCT(SHFLSTRING, 6);
58 STRUCT(SHFLCREATERESULT, 4);
59 STRUCT(SHFLCREATEPARMS, 108);
60 STRUCT(SHFLMAPPING, 8);
61 STRUCT(SHFLDIRINFO, 128);
62 STRUCT(SHFLVOLINFO, 40);
63 STRUCT(VBoxSFQueryMappings, 52);
64 STRUCT(VBoxSFQueryMapName, 52);
65 STRUCT(VBoxSFMapFolder, 52);
66 STRUCT(VBoxSFUnmapFolder, 28);
67 STRUCT(VBoxSFCreate, 52);
68 STRUCT(VBoxSFClose, 40);
69 STRUCT(VBoxSFRead, 76);
70 STRUCT(VBoxSFWrite, 76);
71 STRUCT(VBoxSFLock, 76);
72 STRUCT(VBoxSFFlush, 40);
73 STRUCT(VBoxSFList, 112);
74 STRUCT(VBoxSFInformation, 76);
75 STRUCT(VBoxSFRemove, 52);
76 STRUCT(VBoxSFRename, 64);
77 STRUCT(VBoxSFAddMapping, 40);
78 STRUCT(VBoxSFRemoveMapping, 28);
79
80 /*
81 * The summary.
82 */
83 if (!cErrors)
84 RTPrintf("tstShflSizes: SUCCESS\n");
85 else
86 RTPrintf("tstShflSizes: FAILURE - %d errors\n", cErrors);
87 return !!cErrors;
88}
89
Note: See TracBrowser for help on using the repository browser.

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