Changeset 44223 in vbox for trunk/src/VBox/HostServices/SharedFolders/testcase
- Timestamp:
- Jan 1, 2013 7:25:47 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedFolders/testcase/tstSharedFolderService.cpp
r40108 r44223 1 1 /* $Id$ */ 2 2 /** @file 3 *4 3 * Testcase for the shared folder service vbsf API. 5 4 * … … 12 11 13 12 /* 14 * Copyright (C) 2011 Oracle Corporation13 * Copyright (C) 2011-2012 Oracle Corporation 15 14 * 16 15 * This file is part of VirtualBox Open Source Edition (OSE), as … … 40 39 #include "teststubs.h" 41 40 41 42 42 /****************************************************************************** 43 43 * Global Variables * … … 45 45 static RTTEST g_hTest = NIL_RTTEST; 46 46 47 47 48 /****************************************************************************** 48 49 * Declarations * 49 50 ******************************************************************************/ 50 51 51 extern "C" DECLCALLBACK(DECLEXPORT(int)) VBoxHGCMSvcLoad (VBOXHGCMSVCFNTABLE *ptable); 52 52 53 53 54 /****************************************************************************** … … 103 104 104 105 #define ARRAY_FROM_PATH(a, b) \ 105 do { \ 106 Assert((a) == (a)); /* Constant parameter */ \ 107 Assert(sizeof((a)) > 0); \ 108 bufferFromPath(a, sizeof(a), b); \ 109 } while(0) 106 do { \ 107 Assert((a) == (a)); /* Constant parameter */ \ 108 Assert(sizeof((a)) > 0); \ 109 bufferFromPath(a, sizeof(a), b); \ 110 } while (0) 111 110 112 111 113 /****************************************************************************** 112 * Stub functions 114 * Stub functions and data * 113 115 ******************************************************************************/ 114 116 … … 405 407 { RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; } 406 408 409 407 410 /****************************************************************************** 408 411 * Tests * … … 485 488 const char *pcszSource) 486 489 { 487 unsigned i; 488 489 AssertRelease( strlen(pcszSource) * 2 + 2 < sizeof(*pDest) 490 - RT_UOFFSETOF(SHFLSTRING, String)); 491 pDest->string.u16Size = (uint16_t)strlen(pcszSource) * 2 + 2; 492 pDest->string.u16Length = (uint16_t)strlen(pcszSource); 493 for (i = 0; i < strlen(pcszSource) + 1; ++i) 490 AssertRelease( strlen(pcszSource) * 2 + 2 491 < sizeof(*pDest) - RT_UOFFSETOF(SHFLSTRING, String)); 492 pDest->string.u16Length = (uint16_t)(strlen(pcszSource) * sizeof(RTUTF16)); 493 pDest->string.u16Size = pDest->string.u16Length + sizeof(RTUTF16); 494 for (unsigned i = 0; i <= pDest->string.u16Length; ++i) 494 495 pDest->string.String.ucs2[i] = (uint16_t)pcszSource[i]; 495 496 }
Note:
See TracChangeset
for help on using the changeset viewer.