VirtualBox

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

Last change on this file since 78230 was 77685, checked in by vboxsync, 6 years ago

SharedFolders: Use RTFileOpenEx to get a more accurate SHFL_FILE_EXISTS/SHFL_FILE_CREATED/SHFL_FILE_REPLACED values to return to the guest. ticketref:9276

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.1 KB
Line 
1/** @file
2 * VBox Shared Folders testcase stub redefinitions.
3 */
4
5/*
6 * Copyright (C) 2011-2019 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 VBOX_INCLUDED_SRC_SharedFolders_teststubs_h
24#define VBOX_INCLUDED_SRC_SharedFolders_teststubs_h
25#ifndef RT_WITHOUT_PRAGMA_ONCE
26# pragma once
27#endif
28
29#include <iprt/dir.h>
30#include <iprt/file.h>
31#include <iprt/time.h>
32
33#define RTDirClose testRTDirClose
34extern int testRTDirClose(RTDIR hDir);
35#define RTDirCreate testRTDirCreate
36extern int testRTDirCreate(const char *pszPath, RTFMODE fMode, uint32_t fCreate);
37#define RTDirOpen testRTDirOpen
38extern int testRTDirOpen(RTDIR *phDir, const char *pszPath);
39#define RTDirOpenFiltered testRTDirOpenFiltered
40extern int testRTDirOpenFiltered(RTDIR *phDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t fFlags);
41#define RTDirQueryInfo testRTDirQueryInfo
42extern int testRTDirQueryInfo(RTDIR hDir, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs);
43#define RTDirRemove testRTDirRemove
44extern int testRTDirRemove(const char *pszPath);
45#define RTDirReadEx testRTDirReadEx
46extern int testRTDirReadEx(RTDIR hDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags);
47#define RTDirSetTimes testRTDirSetTimes
48extern int testRTDirSetTimes(RTDIR hDir, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime, PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime);
49#define RTFileClose testRTFileClose
50extern int testRTFileClose(RTFILE hFile);
51#define RTFileDelete testRTFileDelete
52extern int testRTFileDelete(const char *pszFilename);
53#define RTFileFlush testRTFileFlush
54extern int testRTFileFlush(RTFILE hFile);
55#define RTFileLock testRTFileLock
56extern int testRTFileLock(RTFILE hFile, unsigned fLock, int64_t offLock, uint64_t cbLock);
57#define RTFileOpenEx testRTFileOpenEx
58extern int testRTFileOpenEx(const char *pszFilename, uint64_t fOpen, PRTFILE phFile, PRTFILEACTION penmActionTaken);
59#define RTFileQueryInfo testRTFileQueryInfo
60extern int testRTFileQueryInfo(RTFILE hFile, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs);
61#define RTFileRead testRTFileRead
62extern int testRTFileRead(RTFILE hFile, void *pvBuf, size_t cbToRead, size_t *pcbRead);
63#define RTFileReadAt testRTFileReadAt
64extern int testRTFileReadAt(RTFILE hFile, uint64_t offFile, void *pvBuf, size_t cbToRead, size_t *pcbRead);
65#define RTFileSetMode testRTFileSetMode
66extern int testRTFileSetMode(RTFILE hFile, RTFMODE fMode);
67#define RTFileSetSize testRTFileSetSize
68extern int testRTFileSetSize(RTFILE hFile, uint64_t cbSize);
69#define RTFileSetTimes testRTFileSetTimes
70extern int testRTFileSetTimes(RTFILE hFile, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime, PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime);
71#define RTFileSeek testRTFileSeek
72extern int testRTFileSeek(RTFILE hFile, int64_t offSeek, unsigned uMethod, uint64_t *poffActual);
73#define RTFileUnlock testRTFileUnlock
74extern int testRTFileUnlock(RTFILE hFile, int64_t offLock, uint64_t cbLock);
75#define RTFileWrite testRTFileWrite
76extern int testRTFileWrite(RTFILE hFile, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten);
77#define RTFileWriteAt testRTFileWriteAt
78extern int testRTFileWriteAt(RTFILE hFile, uint64_t offFile, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten);
79#define RTFsQueryProperties testRTFsQueryProperties
80extern int testRTFsQueryProperties(const char *pszFsPath, PRTFSPROPERTIES pProperties);
81#define RTFsQuerySerial testRTFsQuerySerial
82extern int testRTFsQuerySerial(const char *pszFsPath, uint32_t *pu32Serial);
83#define RTFsQuerySizes testRTFsQuerySizes
84extern int testRTFsQuerySizes(const char *pszFsPath, RTFOFF *pcbTotal, RTFOFF *pcbFree, uint32_t *pcbBlock, uint32_t *pcbSector);
85#define RTPathQueryInfoEx testRTPathQueryInfoEx
86extern int testRTPathQueryInfoEx(const char *pszPath, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags);
87#define RTSymlinkDelete testRTSymlinkDelete
88extern int testRTSymlinkDelete(const char *pszSymlink, uint32_t fDelete);
89#define RTSymlinkRead testRTSymlinkRead
90extern int testRTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead);
91
92#endif /* !VBOX_INCLUDED_SRC_SharedFolders_teststubs_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