VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedFolders/teststubs.h@ 39858

Last change on this file since 39858 was 39612, checked in by vboxsync, 13 years ago

IPRT/*: add _NO_SYMLINKS flags to certain functions

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.4 KB
Line 
1/** @file
2 * VBox Shared Folders testcase stub redefinitions.
3 */
4
5/*
6 * Copyright (C) 2011 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 */
16
17/**
18 * Macros for renaming iprt file operations to redirect them to testcase
19 * stub functions (mocks). The religiously correct way to do this would be
20 * to make the service use a file operations structure with function pointers
21 * but I'm not sure that would be universally appreciated. */
22
23#ifndef __VBSF_TEST_STUBS__H
24#define __VBSF_TEST_STUBS__H
25
26#include <iprt/dir.h>
27#include <iprt/time.h>
28
29#define RTDirClose testRTDirClose
30extern int testRTDirClose(PRTDIR pDir);
31#define RTDirCreate testRTDirCreate
32extern int testRTDirCreate(const char *pszPath, RTFMODE fMode, uint32_t fCreate);
33#define RTDirOpen testRTDirOpen
34extern int testRTDirOpen(PRTDIR *ppDir, const char *pszPath);
35#define RTDirQueryInfo testRTDirQueryInfo
36extern int testRTDirQueryInfo(PRTDIR pDir, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs);
37#define RTDirRemove testRTDirRemove
38extern int testRTDirRemove(const char *pszPath);
39#define RTDirReadEx testRTDirReadEx
40extern int testRTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags);
41#define RTDirSetTimes testRTDirSetTimes
42extern int testRTDirSetTimes(PRTDIR pDir, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime, PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime);
43#define RTFileClose testRTFileClose
44extern int testRTFileClose(RTFILE hFile);
45#define RTFileDelete testRTFileDelete
46extern int testRTFileDelete(const char *pszFilename);
47#define RTFileFlush testRTFileFlush
48extern int testRTFileFlush(RTFILE hFile);
49#define RTFileLock testRTFileLock
50extern int testRTFileLock(RTFILE hFile, unsigned fLock, int64_t offLock, uint64_t cbLock);
51#define RTFileOpen testRTFileOpen
52extern int testRTFileOpen(PRTFILE pFile, const char *pszFilename, uint64_t fOpen);
53#define RTFileQueryInfo testRTFileQueryInfo
54extern int testRTFileQueryInfo(RTFILE hFile, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs);
55#define RTFileRead testRTFileRead
56extern int testRTFileRead(RTFILE hFile, void *pvBuf, size_t cbToRead, size_t *pcbRead);
57#define RTFileSetMode testRTFileSetMode
58extern int testRTFileSetMode(RTFILE hFile, RTFMODE fMode);
59#define RTFileSetSize testRTFileSetSize
60extern int testRTFileSetSize(RTFILE hFile, uint64_t cbSize);
61#define RTFileSetTimes testRTFileSetTimes
62extern int testRTFileSetTimes(RTFILE hFile, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime, PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime);
63#define RTFileSeek testRTFileSeek
64extern int testRTFileSeek(RTFILE hFile, int64_t offSeek, unsigned uMethod, uint64_t *poffActual);
65#define RTFileUnlock testRTFileUnlock
66extern int testRTFileUnlock(RTFILE hFile, int64_t offLock, uint64_t cbLock);
67#define RTFileWrite testRTFileWrite
68extern int testRTFileWrite(RTFILE hFile, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten);
69#define RTFsQueryProperties testRTFsQueryProperties
70extern int testRTFsQueryProperties(const char *pszFsPath, PRTFSPROPERTIES pProperties);
71#define RTFsQuerySerial testRTFsQuerySerial
72extern int testRTFsQuerySerial(const char *pszFsPath, uint32_t *pu32Serial);
73#define RTFsQuerySizes testRTFsQuerySizes
74extern int testRTFsQuerySizes(const char *pszFsPath, RTFOFF *pcbTotal, RTFOFF *pcbFree, uint32_t *pcbBlock, uint32_t *pcbSector);
75#define RTPathQueryInfoEx testRTPathQueryInfoEx
76extern int testRTPathQueryInfoEx(const char *pszPath, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags);
77#define RTSymlinkDelete testRTSymlinkDelete
78extern int testRTSymlinkDelete(const char *pszSymlink, uint32_t fDelete);
79#define RTSymlinkRead testRTSymlinkRead
80extern int testRTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead);
81
82#endif /* __VBSF_TEST_STUBS__H */
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