VirtualBox

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

Last change on this file since 8155 was 8155, checked in by vboxsync, 17 years ago

The Big Sun Rebranding Header Change

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 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 Sun Microsystems, Inc.
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 (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
19 * Clara, CA 95054 USA or visit http://www.sun.com if you need
20 * additional information or have any questions.
21 */
22
23/*******************************************************************************
24* Header Files *
25*******************************************************************************/
26#include <VBox/shflsvc.h>
27#include <iprt/stream.h>
28#include <iprt/string.h>
29
30#define STRUCT(t, size) \
31 do { \
32 if (fPrintChecks) \
33 RTPrintf(" STRUCT(" #t ", %d);\n", (int)sizeof(t)); \
34 else if ((size) != sizeof(t)) \
35 { \
36 RTPrintf("%30s: %d expected %d!\n", #t, (int)sizeof(t), (size)); \
37 cErrors++; \
38 } \
39 else if (!fQuiet)\
40 RTPrintf("%30s: %d\n", #t, (int)sizeof(t)); \
41 } while (0)
42
43
44int main(int argc, char **argv)
45{
46 unsigned cErrors = 0;
47
48 /*
49 * Prints the code below if any argument was giving.
50 */
51 bool fQuiet = argc == 2 && !strcmp(argv[1], "quiet");
52 bool fPrintChecks = !fQuiet && argc != 1;
53
54 RTPrintf("tstShflSizes: TESTING\n");
55
56 /*
57 * The checks.
58 */
59 STRUCT(SHFLROOT, 4);
60 STRUCT(SHFLHANDLE, 8);
61 STRUCT(SHFLSTRING, 6);
62 STRUCT(SHFLCREATERESULT, 4);
63 STRUCT(SHFLCREATEPARMS, 108);
64 STRUCT(SHFLMAPPING, 8);
65 STRUCT(SHFLDIRINFO, 128);
66 STRUCT(SHFLVOLINFO, 40);
67 STRUCT(VBoxSFQueryMappings, 52);
68 STRUCT(VBoxSFQueryMapName, 40); /* this was changed from 52 in 21976 after VBox-1.4. */
69 STRUCT(VBoxSFMapFolder_Old, 52);
70 STRUCT(VBoxSFMapFolder, 64);
71 STRUCT(VBoxSFUnmapFolder, 28);
72 STRUCT(VBoxSFCreate, 52);
73 STRUCT(VBoxSFClose, 40);
74 STRUCT(VBoxSFRead, 76);
75 STRUCT(VBoxSFWrite, 76);
76 STRUCT(VBoxSFLock, 76);
77 STRUCT(VBoxSFFlush, 40);
78 STRUCT(VBoxSFList, 112);
79 STRUCT(VBoxSFInformation, 76);
80 STRUCT(VBoxSFRemove, 52);
81 STRUCT(VBoxSFRename, 64);
82
83 /* The following requests are only available from the host. */
84 STRUCT(VBoxSFAddMapping, 52);
85 STRUCT(VBoxSFRemoveMapping, 28);
86 STRUCT(VBoxSFSetStatusLed, 28);
87
88 /*
89 * The summary.
90 */
91 if (!cErrors)
92 RTPrintf("tstShflSizes: SUCCESS\n");
93 else
94 RTPrintf("tstShflSizes: FAILURE - %d errors\n", cErrors);
95 return !!cErrors;
96}
97
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