Hotwheels-Cluster 1.2
Creation of Cluster APP for SEA:ME project.
 
Loading...
Searching...
No Matches
MockSysCalls.hpp File Reference

File containing Mock classes to test the system calls. More...

#include <fcntl.h>
#include <gmock/gmock.h>
#include <sys/ioctl.h>
#include <unistd.h>

Go to the source code of this file.

Data Structures

class  MockSysCalls
 Class to emulate the behavior of the system calls. More...
 

Functions

int mock_open (const char *path, int flags,...)
 Mocked open function.
 
int mock_ioctl (int fd, unsigned long request,...)
 Mocked ioctl function.
 
int mock_close (int fd)
 Mocked close function.
 

Detailed Description

File containing Mock classes to test the system calls.

This file provides a mock implementation of system calls for testing purposes. It uses Google Mock to create mock methods for open, ioctl, and close system calls.

Version
0.1
Date
2025-01-30
Author
Félix LE BIHAN (@Fle-bihh)
Ricardo Melo (@reomelo)
Tiago Pereira (@t-pereira06)
Michel Batista (@MicchelFAB)

License

Definition in file MockSysCalls.hpp.

Function Documentation

◆ mock_close()

int mock_close ( int fd)
inline

Mocked close function.

Parameters
fdThe file descriptor.
Returns
a mocked close return value.
Return values
int

Definition at line 90 of file MockSysCalls.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mock_ioctl()

int mock_ioctl ( int fd,
unsigned long request,
... )
inline

Mocked ioctl function.

Parameters
fdThe file descriptor.
requestThe request code.
Returns
a mocked ioctl return value.
Return values
int

Definition at line 80 of file MockSysCalls.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mock_open()

int mock_open ( const char * path,
int flags,
... )
inline

Mocked open function.

Parameters
pathThe path to the file to open.
flagsThe flags for opening the file.
Returns
a mocked file descriptor.
Return values
int

Definition at line 69 of file MockSysCalls.hpp.

Here is the call graph for this function:
Here is the caller graph for this function: