VirtualBox

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

Last change on this file since 96407 was 96407, checked in by vboxsync, 2 years ago

scm copyright and license note update

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.5 KB
Line 
1/** @file
2 * VBox Shared Folders testcase stub redefinitions.
3 */
4
5/*
6 * Copyright (C) 2011-2022 Oracle and/or its affiliates.
7 *
8 * This file is part of VirtualBox base platform packages, as
9 * available from https://www.virtualbox.org.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation, in version 3 of the
14 * License.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, see <https://www.gnu.org/licenses>.
23 *
24 * SPDX-License-Identifier: GPL-3.0-only
25 */
26
27/**
28 * Macros for renaming iprt file operations to redirect them to testcase
29 * stub functions (mocks). The religiously correct way to do this would be
30 * to make the service use a file operations structure with function pointers
31 * but I'm not sure that would be universally appreciated. */
32
33#ifndef VBOX_INCLUDED_SRC_SharedFolders_teststubs_h
34#define VBOX_INCLUDED_SRC_SharedFolders_teststubs_h
35#ifndef RT_WITHOUT_PRAGMA_ONCE
36# pragma once
37#endif
38
39#include <iprt/dir.h>
40#include <iprt/file.h>
41#include <iprt/time.h>
42
43#define RTDirClose testRTDirClose
44extern int testRTDirClose(RTDIR hDir);
45#define RTDirCreate testRTDirCreate
46extern int testRTDirCreate(const char *pszPath, RTFMODE fMode, uint32_t fCreate);
47#define RTDirOpen testRTDirOpen
48extern int testRTDirOpen(RTDIR *phDir, const char *pszPath);
49#define RTDirOpenFiltered testRTDirOpenFiltered
50extern int testRTDirOpenFiltered(RTDIR *phDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t fFlags);
51#define RTDirQueryInfo testRTDirQueryInfo
52extern int testRTDirQueryInfo(RTDIR hDir, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs);
53#define RTDirRemove testRTDirRemove
54extern int testRTDirRemove(const char *pszPath);
55#define RTDirReadEx testRTDirReadEx
56extern int testRTDirReadEx(RTDIR hDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags);
57#define RTDirSetMode testRTDirSetMode
58extern int testRTDirSetMode(RTDIR hDir, RTFMODE fMode);
59#define RTDirSetTimes testRTDirSetTimes
60extern int testRTDirSetTimes(RTDIR hDir, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime, PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime);
61#define RTFileClose testRTFileClose
62extern int testRTFileClose(RTFILE hFile);
63#define RTFileDelete testRTFileDelete
64extern int testRTFileDelete(const char *pszFilename);
65#define RTFileFlush testRTFileFlush
66extern int testRTFileFlush(RTFILE hFile);
67#define RTFileLock testRTFileLock
68extern int testRTFileLock(RTFILE hFile, unsigned fLock, int64_t offLock, uint64_t cbLock);
69#define RTFileOpenEx testRTFileOpenEx
70extern int testRTFileOpenEx(const char *pszFilename, uint64_t fOpen, PRTFILE phFile, PRTFILEACTION penmActionTaken);
71#define RTFileQueryInfo testRTFileQueryInfo
72extern int testRTFileQueryInfo(RTFILE hFile, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs);
73#define RTFileRead testRTFileRead
74extern int testRTFileRead(RTFILE hFile, void *pvBuf, size_t cbToRead, size_t *pcbRead);
75#define RTFileReadAt testRTFileReadAt
76extern int testRTFileReadAt(RTFILE hFile, uint64_t offFile, void *pvBuf, size_t cbToRead, size_t *pcbRead);
77#define RTFileSetMode testRTFileSetMode
78extern int testRTFileSetMode(RTFILE hFile, RTFMODE fMode);
79#define RTFileSetSize testRTFileSetSize
80extern int testRTFileSetSize(RTFILE hFile, uint64_t cbSize);
81#define RTFileSetTimes testRTFileSetTimes
82extern int testRTFileSetTimes(RTFILE hFile, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime, PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime);
83#define RTFileSeek testRTFileSeek
84extern int testRTFileSeek(RTFILE hFile, int64_t offSeek, unsigned uMethod, uint64_t *poffActual);
85#define RTFileUnlock testRTFileUnlock
86extern int testRTFileUnlock(RTFILE hFile, int64_t offLock, uint64_t cbLock);
87#define RTFileWrite testRTFileWrite
88extern int testRTFileWrite(RTFILE hFile, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten);
89#define RTFileWriteAt testRTFileWriteAt
90extern int testRTFileWriteAt(RTFILE hFile, uint64_t offFile, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten);
91#define RTFsQueryProperties testRTFsQueryProperties
92extern int testRTFsQueryProperties(const char *pszFsPath, PRTFSPROPERTIES pProperties);
93#define RTFsQuerySerial testRTFsQuerySerial
94extern int testRTFsQuerySerial(const char *pszFsPath, uint32_t *pu32Serial);
95#define RTFsQuerySizes testRTFsQuerySizes
96extern int testRTFsQuerySizes(const char *pszFsPath, RTFOFF *pcbTotal, RTFOFF *pcbFree, uint32_t *pcbBlock, uint32_t *pcbSector);
97#define RTPathQueryInfoEx testRTPathQueryInfoEx
98extern int testRTPathQueryInfoEx(const char *pszPath, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags);
99#define RTSymlinkDelete testRTSymlinkDelete
100extern int testRTSymlinkDelete(const char *pszSymlink, uint32_t fDelete);
101#define RTSymlinkRead testRTSymlinkRead
102extern int testRTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead);
103
104#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