#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <mock.h>
#include <hipc/session.h>
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[]) |
#define S HIPC_SUCCESS |
Definition at line 9 of file test_session.c.
Referenced by closeDefaultSession(), openDefaultSession(), test_hipcClose_err(), test_hipcGet_err(), test_hipcOpen_err(), test_hipcPut_err(), test_hipcSession(), test_hipcSession_cast(), and test_hipcWaitReturn_err().
#define R 0 |
Definition at line 10 of file test_session.c.
Referenced by closeDefaultSession(), openDefaultSession(), test_hipcClose_err(), test_hipcGet_err(), test_hipcOpen_err(), test_hipcPut_err(), test_hipcSession(), test_hipcSession_cast(), and test_hipcWaitReturn_err().
#define W 1 |
Definition at line 11 of file test_session.c.
Referenced by closeDefaultSession(), openDefaultSession(), test_hipcClose_err(), test_hipcGet_err(), test_hipcOpen_err(), test_hipcPut_err(), test_hipcSession(), and test_hipcSession_cast().
|
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().
|
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().
|
static |
Definition at line 40 of file test_session.c.
References HIPC_ERRCHECK, HIPC_MESSAGE_TYPE_HELLO, HIPC_MESSAGE_TYPE_SYS, HIPC_UNSTRU, hipcOpen(), HIPCUD_cfgmock1_CCFG, MOCK1S1::m1, MOCK1S1::m2, mockIOCheckCompletion(), mockIOInit(), mockReadMsg(), mockWriteMsg(), R, S, and W.
Referenced by test_hipcClose_err(), test_hipcGet_err(), test_hipcPut_err(), test_hipcSession(), test_hipcSession_cast(), test_hipcSetHandler_err(), and test_hipcWaitReturn_err().
|
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().
|
static |
Definition at line 78 of file test_session.c.
References closeDefaultSession(), HIPC_ERR_INV_BASE_CLIENT, HIPC_ERR_SESS_STATE_MISMATCH, HIPC_ERRCHECK, HIPC_MESSAGE_TYPE_GET, HIPC_MESSAGE_TYPE_PUT, HIPC_MESSAGE_TYPE_SUCCESS, HIPC_UNSTRU, hipcClose(), hipcGet(), hipcOpen(), hipcPut(), HIPCUD_MOCK1S1, MOCK1S1::m1, mockIOCheckCompletion(), mockIOInit(), mockReadMsg(), mockWriteMsg(), openDefaultSession(), R, S, and W.
Referenced by main().
|
static |
Definition at line 130 of file test_session.c.
References HIPC_SUCCESS, and MOCK2S1::m1.
Referenced by test_hipcSession_cast().
|
static |
Definition at line 147 of file test_session.c.
Referenced by test_hipcSession_cast().
|
static |
Definition at line 158 of file test_session.c.
References closeDefaultSession(), handler_MOCK2S1(), handler_msg(), HIPC_ERR_FOR_TESTING, HIPC_ERRCHECK, HIPC_MESSAGE_TYPE_BYE, HIPC_MESSAGE_TYPE_CAST, HIPC_MESSAGE_TYPE_GET, HIPC_MESSAGE_TYPE_HELLO, HIPC_MESSAGE_TYPE_PUT, HIPC_MESSAGE_TYPE_QUIT, HIPC_MESSAGE_TYPE_SUCCESS, HIPC_MESSAGE_TYPE_SYS, HIPC_SUCCESS, HIPC_UNSTRU, hipcClose(), hipcGet(), hipcOpen(), hipcPut(), hipcSetHandler(), HIPCUD_cfgmock2_CCFG, HIPCUD_MOCK1S1, HIPCUD_MOCK2S1, HIPCUD_MOCK2S2, MOCK2S1::m1, MOCK1S1::m1, MOCK2S2::m1, MOCK2S2::m2, mockIOCheckCompletion(), mockIOInit(), mockReadMsg(), mockWriteMsg(), openDefaultSession(), R, S, and W.
Referenced by main().
|
static |
Definition at line 291 of file test_session.c.
References HIPC_ERR_INV_BASE_CLIENT, HIPC_ERR_IO_READ, HIPC_ERR_IO_WRITE, HIPC_ERR_MBR_SIZE_MISMATCH, HIPC_ERR_PROTOCOL_VIOLATION, HIPC_ERR_S_BUF_SHTG, HIPC_MESSAGE_TYPE_HELLO, HIPC_MESSAGE_TYPE_QUIT, HIPC_MESSAGE_TYPE_SUCCESS, HIPC_MESSAGE_TYPE_SYS, HIPC_UNSTRU, hipcClose(), hipcOpen(), HIPCUD_cfgmock1_CCFG, MOCK1S1::m1, MOCK1S1::m2, mockIOCheckCompletion(), mockIOInit(), mockReadMsg(), mockWriteMsg(), R, S, and W.
Referenced by main().
|
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().
|
static |
Definition at line 410 of file test_session.c.
References closeDefaultSession(), HIPC_ERR_INV_ID_STR, HIPC_ERR_IO_READ, HIPC_ERR_IO_WRITE, HIPC_ERR_SESS_STATE_MISMATCH, HIPC_MESSAGE_TYPE_GET, HIPC_MESSAGE_TYPE_SUCCESS, HIPC_SESS_TERMINATED, hipcGet(), HIPCUD_MOCK1S1, MOCK1S1::m1, mockIOCheckCompletion(), mockIOInit(), openDefaultSession(), R, S, HIPC_session::state, and W.
Referenced by main().
|
static |
Definition at line 451 of file test_session.c.
References closeDefaultSession(), HIPC_ERR_INV_ID_STR, HIPC_ERR_IO_READ, HIPC_ERR_IO_WRITE, HIPC_ERR_SESS_STATE_MISMATCH, HIPC_MESSAGE_TYPE_PUT, HIPC_MESSAGE_TYPE_SUCCESS, HIPC_SESS_TERMINATED, HIPC_UNSTRU, hipcPut(), HIPCUD_MOCK1S1, MOCK1S1::m1, mockIOCheckCompletion(), mockIOInit(), openDefaultSession(), R, S, HIPC_session::state, and W.
Referenced by main().
|
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().
|
static |
Definition at line 510 of file test_session.c.
References HIPC_ERR_FOR_TESTING, and hipcClientSetError().
Referenced by test_hipcWaitReturn_err().
|
static |
Definition at line 517 of file test_session.c.
References HIPC_session::cl, closeDefaultSession(), handler_err(), HIPC_ERR_FOR_TESTING, HIPC_ERR_PROTOCOL_VIOLATION, HIPC_ERR_SESS_STATE_MISMATCH, HIPC_MESSAGE_TYPE_BYE, HIPC_MESSAGE_TYPE_CAST, HIPC_SESS_TERMINATED, HIPC_UNSTRU, hipcClientGetErrDtlStr(), hipcSetHandler(), HIPCUD_MOCK1S1, hipcWaitReturn(), mockIOCheckCompletion(), mockIOInit(), openDefaultSession(), R, S, and HIPC_session::state.
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 567 of file test_session.c.
References test_hipcClose_err(), test_hipcGet_err(), test_hipcOpen_err(), test_hipcPut_err(), test_hipcSession(), test_hipcSession_cast(), test_hipcSetHandler_err(), and test_hipcWaitReturn_err().