VirtualBox

Ignore:
Timestamp:
Dec 6, 2011 4:48:23 PM (13 years ago)
Author:
vboxsync
Message:

HostServices/SharedFolders: starter unit test, try to make Windows happy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedFolders/testcase/tstSharedFolderService.cpp

    r39540 r39542  
    2727******************************************************************************/
    2828
    29 #include "teststubs.h"
    3029#include "tstSharedFolderService.h"
    3130#include "vbsf.h"
     
    3938#include <iprt/test.h>
    4039
     40#include "teststubs.h"
    4141
    4242/******************************************************************************
     
    115115static PRTDIR testRTDirClosepDir;
    116116
    117 RTDECL(int) testRTDirClose(PRTDIR pDir)
     117extern int testRTDirClose(PRTDIR pDir)
    118118{
    119119 /* RTPrintf("%s: pDir=%p\n", __func__, pDir); */
     
    125125static RTFMODE testRTDirCreateMode;
    126126
    127 RTDECL(int) testRTDirCreate(const char *pszPath, RTFMODE fMode)
     127extern int testRTDirCreate(const char *pszPath, RTFMODE fMode)
    128128{
    129129 /* RTPrintf("%s: pszPath=%s, fMode=0x%llx\n", __func__, pszPath,
     
    136136static PRTDIR testRTDirOpenpDir;
    137137
    138 RTDECL(int) testRTDirOpen(PRTDIR *ppDir, const char *pszPath)
     138extern int testRTDirOpen(PRTDIR *ppDir, const char *pszPath)
    139139{
    140140 /* RTPrintf("%s: pszPath=%s\n", __func__, pszPath); */
     
    148148static RTTIMESPEC testRTDirQueryInfoATime;
    149149
    150 RTDECL(int) testRTDirQueryInfo(PRTDIR pDir, PRTFSOBJINFO pObjInfo,
     150extern int testRTDirQueryInfo(PRTDIR pDir, PRTFSOBJINFO pObjInfo,
    151151                               RTFSOBJATTRADD enmAdditionalAttribs)
    152152{
     
    160160}
    161161
    162 RTDECL(int) testRTDirRemove(const char *pszPath) { RTPrintf("%s\n", __func__); return 0; }
     162extern int testRTDirRemove(const char *pszPath) { RTPrintf("%s\n", __func__); return 0; }
    163163
    164164static PRTDIR testRTDirReadExDir;
    165165
    166 RTDECL(int) testRTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry,
     166extern int testRTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry,
    167167                            size_t *pcbDirEntry,
    168168                            RTFSOBJATTRADD enmAdditionalAttribs,
     
    199199static RTFILE testRTFileCloseFile;
    200200
    201 RTDECL(int)  testRTFileClose(RTFILE File)
     201extern int  testRTFileClose(RTFILE File)
    202202{
    203203 /* RTPrintf("%s: File=%p\n", __func__, File); */
     
    206206}
    207207
    208 RTDECL(int)  testRTFileDelete(const char *pszFilename) { RTPrintf("%s\n", __func__); return 0; }
     208extern int  testRTFileDelete(const char *pszFilename) { RTPrintf("%s\n", __func__); return 0; }
    209209
    210210static RTFILE testRTFileFlushFile;
    211211
    212 RTDECL(int)  testRTFileFlush(RTFILE File)
     212extern int  testRTFileFlush(RTFILE File)
    213213{
    214214 /* RTPrintf("%s: File=%p\n", __func__, File); */
     
    222222static uint64_t testRTFileLockSize;
    223223
    224 RTDECL(int)  testRTFileLock(RTFILE hFile, unsigned fLock, int64_t offLock,
     224extern int  testRTFileLock(RTFILE hFile, unsigned fLock, int64_t offLock,
    225225                            uint64_t cbLock)
    226226{
     
    238238static RTFILE testRTFileOpenpFile;
    239239
    240 RTDECL(int)  testRTFileOpen(PRTFILE pFile, const char *pszFilename,
     240extern int  testRTFileOpen(PRTFILE pFile, const char *pszFilename,
    241241                            uint64_t fOpen)
    242242{
     
    254254static uint32_t testRTFileQueryInfoFMode;
    255255
    256 RTDECL(int)  testRTFileQueryInfo(RTFILE hFile, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs)
     256extern int  testRTFileQueryInfo(RTFILE hFile, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs)
    257257{
    258258 /* RTPrintf("%s, hFile=%p, enmAdditionalAttribs=0x%llx\n", __func__,
     
    269269static const char *testRTFileReadData;
    270270
    271 RTDECL(int)  testRTFileRead(RTFILE File, void *pvBuf, size_t cbToRead,
     271extern int  testRTFileRead(RTFILE File, void *pvBuf, size_t cbToRead,
    272272                            size_t *pcbRead)
    273273{
     
    281281}
    282282
    283 RTDECL(int) testRTFileSeek(RTFILE hFile, int64_t offSeek, unsigned uMethod,
     283extern int testRTFileSeek(RTFILE hFile, int64_t offSeek, unsigned uMethod,
    284284                           uint64_t *poffActual)
    285285{
     
    293293static uint64_t testRTFileSetFMode;
    294294
    295 RTDECL(int) testRTFileSetMode(RTFILE File, RTFMODE fMode)
     295extern int testRTFileSetMode(RTFILE File, RTFMODE fMode)
    296296{
    297297 /* RTPrintf("%s: fMode=%llu\n", __func__, LLUIFY(fMode)); */
     
    303303static RTFOFF testRTFileSetSizeSize;
    304304
    305 RTDECL(int)  testRTFileSetSize(RTFILE File, uint64_t cbSize)
     305extern int  testRTFileSetSize(RTFILE File, uint64_t cbSize)
    306306{
    307307 /* RTPrintf("%s: File=%llu, cbSize=%llu\n", __func__, LLUIFY(File),
     
    314314static RTTIMESPEC testRTFileSetTimesATime;
    315315
    316 RTDECL(int) testRTFileSetTimes(RTFILE File, PCRTTIMESPEC pAccessTime,
     316extern int testRTFileSetTimes(RTFILE File, PCRTTIMESPEC pAccessTime,
    317317                               PCRTTIMESPEC pModificationTime,
    318318                               PCRTTIMESPEC pChangeTime,
     
    337337static uint64_t testRTFileUnlockSize;
    338338
    339 RTDECL(int)  testRTFileUnlock(RTFILE File, int64_t offLock, uint64_t cbLock)
     339extern int  testRTFileUnlock(RTFILE File, int64_t offLock, uint64_t cbLock)
    340340{
    341341 /* RTPrintf("%s: hFile=%p, ofLock=%lli, cbLock=%llu\n", __func__,
     
    349349static char testRTFileWriteData[256];
    350350
    351 RTDECL(int)  testRTFileWrite(RTFILE File, const void *pvBuf, size_t cbToWrite,
     351extern int  testRTFileWrite(RTFILE File, const void *pvBuf, size_t cbToWrite,
    352352                             size_t *pcbWritten)
    353353{
     
    388388}
    389389
    390 RTDECL(int) testRTSymlinkDelete(const char *pszSymlink) { RTPrintf("%s\n", __func__); return 0; }
    391 RTDECL(int) testRTSymlinkRead(const char *pszSymlink, char *pszTarget,
     390extern int testRTSymlinkDelete(const char *pszSymlink) { RTPrintf("%s\n", __func__); return 0; }
     391extern int testRTSymlinkRead(const char *pszSymlink, char *pszTarget,
    392392                              size_t cbTarget) { RTPrintf("%s\n", __func__); return 0; }
    393393
     
    476476    AssertRelease(  strlen(pcszSource) * 2 + 2 < sizeof(*pDest)
    477477                  - RT_UOFFSETOF(SHFLSTRING, String));
    478     pDest->string.u16Size = strlen(pcszSource) * 2 + 2;
    479     pDest->string.u16Length = strlen(pcszSource);
     478    pDest->string.u16Size = (uint16_t)strlen(pcszSource) * 2 + 2;
     479    pDest->string.u16Length = (uint16_t)strlen(pcszSource);
    480480    for (i = 0; i < strlen(pcszSource) + 1; ++i)
    481481        pDest->string.String.ucs2[i] = (uint16_t)pcszSource[i];
     
    778778    testRTFileReadData = pcszReadData;
    779779    rc = readFile(&svcTable, Root, Handle, 0, strlen(pcszReadData) + 1,
    780                   &cbRead, acBuf, sizeof(acBuf));
     780                  &cbRead, acBuf, (uint32_t)sizeof(acBuf));
    781781    RTTEST_CHECK_RC_OK(hTest, rc);
    782782    RTTEST_CHECK_MSG(hTest,
     
    800800    SHFLHANDLE Handle;
    801801    const char *pcszWrittenData = "Data to write";
    802     uint32_t cbToWrite = strlen(pcszWrittenData) + 1;
     802    uint32_t cbToWrite = (uint32_t)strlen(pcszWrittenData) + 1;
    803803    uint32_t cbWritten;
    804804    int rc;
Note: See TracChangeset for help on using the changeset viewer.

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