HIPC  0.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Macros | Functions
test_usocutils.c File Reference
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <mock.h>
#include <hipc/usoc.h>
#include <hipc/usocutils.h>
Include dependency graph for test_usocutils.c:

Go to the source code of this file.

Data Structures

struct  HIPC_usoc
 

Macros

#define S   HIPC_SUCCESS
 
#define R   0
 
#define W   1
 

Functions

enum HIPC_errno hipcUsocRead (struct HIPC_usoc *so_p, void *buf, const size_t size)
 Reads exactly size bytes from so_p. More...
 
enum HIPC_errno hipcUsocWrite (struct HIPC_usoc *so_p, const void *buf, const size_t size)
 Writes exactly size bytes to so_p. More...
 
static void test_hipcUsocWriteMsgd (void)
 
static void test_hipcUsocAccept (void)
 
static void test_hipcUsocAcceptSimple (void)
 
int main (int argc, char *argv[])
 

Macro Definition Documentation

#define S   HIPC_SUCCESS
#define R   0

Definition at line 11 of file test_usocutils.c.

Referenced by test_hipcUsocAccept(), and test_hipcUsocAcceptSimple().

#define W   1

Function Documentation

enum HIPC_errno hipcUsocRead ( struct HIPC_usoc so_p,
void *  buf,
const size_t  size 
)

Reads exactly size bytes from so_p.

Parameters
so_pPointer to a universal socket
bufBuffer into which bytes are read
sizeNumber of bytes to be read
Returns
HIPC_SUCCESS on success, or an error on failure.

Definition at line 19 of file test_usocutils.c.

References HIPC_usoc::mio, and mockIORead().

Referenced by hipcsvsLedRun(), hipcsvsRtRun(), hipcUsocAccept(), and hipcUsocAcceptSimple().

Here is the call graph for this function:

Here is the caller graph for this function:

enum HIPC_errno hipcUsocWrite ( struct HIPC_usoc so_p,
const void *  buf,
const size_t  size 
)

Writes exactly size bytes to so_p.

Parameters
so_pPointer to a universal socket
bufBuffer from which bytes are written
sizeNumber of bytes to be written
Returns
HIPC_SUCCESS on success, or an error on failure.

Definition at line 25 of file test_usocutils.c.

References HIPC_usoc::mio, and mockIOWrite().

Referenced by hipcUsocSendSysmsg(), hipcUsocWriteMsgd(), and send_cast().

Here is the call graph for this function:

Here is the caller graph for this function:

static void test_hipcUsocWriteMsgd ( void  )
static

Definition at line 30 of file test_usocutils.c.

References HIPC_ERR_IO_WRITE, HIPC_MESSAGE_TYPE_QUIT, HIPC_MESSAGE_TYPE_SUCCESS, HIPC_SUCCESS, HIPC_UNSTRU, hipcGenmdQuit, hipcGenmdSuccess, hipcUsocWriteMsgd(), HIPC_usoc::mio, mockIOCheckCompletion(), mockIOInit(), S, and W.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void test_hipcUsocAccept ( void  )
static
static void test_hipcUsocAcceptSimple ( void  )
static
int main ( int  argc,
char *  argv[] 
)

Definition at line 341 of file test_usocutils.c.

References test_hipcUsocAccept(), test_hipcUsocAcceptSimple(), and test_hipcUsocWriteMsgd().

Here is the call graph for this function: