teststubs.h revision ec733c67fa9e0b1b9c63dcfad341ce7c3f573f63
/** @file
* VBox Shared Folders testcase stub redefinitions.
*/
/*
* Copyright (C) 2011 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
/**
* Macros for renaming iprt file operations to redirect them to testcase
* stub functions (mocks). The religiously correct way to do this would be
* to make the service use a file operations structure with function pointers
* but I'm not sure that would be universally appreciated. */
#ifndef __VBSF_TEST_STUBS__H
#define __VBSF_TEST_STUBS__H
#define RTDirClose testRTDirClose
#define RTDirCreate testRTDirCreate
#define RTDirOpen testRTDirOpen
extern int testRTDirOpenFiltered(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t fOpen);
#define RTDirQueryInfo testRTDirQueryInfo
extern int testRTDirQueryInfo(PRTDIR pDir, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs);
#define RTDirRemove testRTDirRemove
extern int testRTDirRemove(const char *pszPath);
#define RTDirReadEx testRTDirReadEx
extern int testRTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags);
#define RTDirSetTimes testRTDirSetTimes
extern int testRTDirSetTimes(PRTDIR pDir, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime, PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime);
#define RTFileClose testRTFileClose
#define RTFileDelete testRTFileDelete
extern int testRTFileDelete(const char *pszFilename);
#define RTFileFlush testRTFileFlush
#define RTFileLock testRTFileLock
#define RTFileOpen testRTFileOpen
#define RTFileQueryInfo testRTFileQueryInfo
extern int testRTFileQueryInfo(RTFILE hFile, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs);
#define RTFileRead testRTFileRead
#define RTFileSetMode testRTFileSetMode
#define RTFileSetSize testRTFileSetSize
#define RTFileSetTimes testRTFileSetTimes
extern int testRTFileSetTimes(RTFILE hFile, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime, PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime);
#define RTFileSeek testRTFileSeek
#define RTFileUnlock testRTFileUnlock
#define RTFileWrite testRTFileWrite
#define RTFsQuerySerial testRTFsQuerySerial
#define RTFsQuerySizes testRTFsQuerySizes
extern int testRTFsQuerySizes(const char *pszFsPath, RTFOFF *pcbTotal, RTFOFF *pcbFree, uint32_t *pcbBlock, uint32_t *pcbSector);
extern int testRTPathQueryInfoEx(const char *pszPath, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags);
#define RTSymlinkDelete testRTSymlinkDelete
#define RTSymlinkRead testRTSymlinkRead
extern int testRTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead);
#endif /* __VBSF_TEST_STUBS__H */