Skip to content

Commit 9e0e485

Browse files
test: Extended SysCalls wrapper with flag to fail access function
Related-To: NEO-12952 Signed-off-by: Slawomir Milczarek <[email protected]>
1 parent 0bff9de commit 9e0e485

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

shared/test/common/os_interface/linux/sys_calls_linux_ult.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ uint32_t mkfifoFuncCalled = 0;
7373
bool failMkfifo = 0;
7474
bool failFcntl = false;
7575
bool failFcntl1 = false;
76+
bool failAccess = false;
7677

7778
std::vector<void *> mmapVector(64);
7879
std::vector<void *> mmapCapturedExtendedPointers(64);
@@ -237,6 +238,9 @@ unsigned long getNumThreads() {
237238

238239
int access(const char *pathName, int mode) {
239240
accessFuncCalled++;
241+
if (failAccess) {
242+
return -1;
243+
}
240244
if (F_OK == mode) {
241245
if (mkfifoPathNamePassed == pathName) {
242246
return 0;

shared/test/common/os_interface/linux/sys_calls_linux_ult.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ extern uint32_t mkfifoFuncCalled;
8181
extern bool failMkfifo;
8282
extern bool failFcntl;
8383
extern bool failFcntl1;
84+
extern bool failAccess;
8485

8586
extern std::vector<void *> mmapVector;
8687
extern std::vector<void *> mmapCapturedExtendedPointers;

0 commit comments

Comments
 (0)