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

Go to the source code of this file.

Macros

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

Functions

static enum HIPC_errno mockReadMsg (void *arg, hipc_msg msg)
 
static enum HIPC_errno mockWriteMsg (void *arg, const hipc_msg msg)
 
static void openDefaultSession (hipc_session *const sess_p, struct MockIO *mio_p)
 
static void closeDefaultSession (hipc_session *const sess_p, struct MockIO *mio_p)
 
static void test_hipcSession (void)
 
static enum HIPC_errno handler_MOCK2S1 (struct HIPC_client *cl_p, const hipc_msg msg, void *cimg, void *arg)
 
static enum HIPC_errno handler_msg (struct HIPC_client *cl_p, const hipc_msg msg, void *cimg, void *arg)
 
static void test_hipcSession_cast (void)
 
static void test_hipcOpen_err (void)
 
static void test_hipcClose_err (void)
 
static void test_hipcGet_err (void)
 
static void test_hipcPut_err (void)
 
static void test_hipcSetHandler_err (void)
 
static enum HIPC_errno handler_err (struct HIPC_client *cl_p, const hipc_msg msg, void *cimg, void *arg)
 
static void test_hipcWaitReturn_err (void)
 
int main (int argc, char *argv[])
 

Macro Definition Documentation

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

Function Documentation

static enum HIPC_errno mockReadMsg ( void *  arg,
hipc_msg  msg 
)
static

Definition at line 13 of file test_session.c.

References HIPC_MSGHDR_SIZE, HIPC_SUCCESS, hipcMsgBdySize(), and mockIORead().

Referenced by openDefaultSession(), test_hipcOpen_err(), test_hipcSession(), and test_hipcSession_cast().

Here is the call graph for this function:

Here is the caller graph for this function:

static enum HIPC_errno mockWriteMsg ( void *  arg,
const hipc_msg  msg 
)
static

Definition at line 33 of file test_session.c.

References hipcMsgTotalSize(), and mockIOWrite().

Referenced by openDefaultSession(), test_hipcOpen_err(), test_hipcSession(), and test_hipcSession_cast().

Here is the call graph for this function:

Here is the caller graph for this function:

static void openDefaultSession ( hipc_session *const  sess_p,
struct MockIO mio_p 
)
static
static void closeDefaultSession ( hipc_session *const  sess_p,
struct MockIO mio_p 
)
static

Definition at line 63 of file test_session.c.

References HIPC_ERRCHECK, HIPC_MESSAGE_TYPE_BYE, HIPC_MESSAGE_TYPE_QUIT, HIPC_UNSTRU, hipcClose(), mockIOCheckCompletion(), mockIOInit(), R, S, and W.

Referenced by test_hipcGet_err(), test_hipcPut_err(), test_hipcSession(), test_hipcSession_cast(), test_hipcSetHandler_err(), and test_hipcWaitReturn_err().

Here is the call graph for this function:

Here is the caller graph for this function:

static void test_hipcSession ( void  )
static
static enum HIPC_errno handler_MOCK2S1 ( struct HIPC_client cl_p,
const hipc_msg  msg,
void *  cimg,
void *  arg 
)
static

Definition at line 130 of file test_session.c.

References HIPC_SUCCESS, and MOCK2S1::m1.

Referenced by test_hipcSession_cast().

Here is the caller graph for this function:

static enum HIPC_errno handler_msg ( struct HIPC_client cl_p,
const hipc_msg  msg,
void *  cimg,
void *  arg 
)
static

Definition at line 147 of file test_session.c.

Referenced by test_hipcSession_cast().

Here is the caller graph for this function:

static void test_hipcSession_cast ( void  )
static
static void test_hipcOpen_err ( void  )
static
static void test_hipcClose_err ( void  )
static

Definition at line 381 of file test_session.c.

References HIPC_ERR_IO_READ, HIPC_ERR_IO_WRITE, HIPC_MESSAGE_TYPE_BYE, HIPC_MESSAGE_TYPE_QUIT, HIPC_UNSTRU, hipcClose(), mockIOCheckCompletion(), mockIOInit(), openDefaultSession(), R, 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_hipcGet_err ( void  )
static
static void test_hipcPut_err ( void  )
static
static void test_hipcSetHandler_err ( void  )
static

Definition at line 493 of file test_session.c.

References closeDefaultSession(), HIPC_ERR_INV_ID_STR, HIPC_ERR_SESS_STATE_MISMATCH, HIPC_SESS_TERMINATED, hipcSetHandler(), openDefaultSession(), and HIPC_session::state.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static enum HIPC_errno handler_err ( struct HIPC_client cl_p,
const hipc_msg  msg,
void *  cimg,
void *  arg 
)
static

Definition at line 510 of file test_session.c.

References HIPC_ERR_FOR_TESTING, and hipcClientSetError().

Referenced by test_hipcWaitReturn_err().

Here is the call graph for this function:

Here is the caller graph for this function:

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