10 #define S HIPC_SUCCESS
38 {
W,
S, 3, {0x68,0x69,0x00}},
89 {
R,
S, 9, {0x43,0x49,0x44,0x5f,0x4d,0x4f,0x43,0x4b,0x31}},
95 sizeof(mstru.
m1),
sizeof(mstru.
m2)}},
103 static unsigned char buf[16];
109 {
R,
S, 9, {0x43,0x49,0x44,0x5f,0x4d,0x4f,0x43,0x4b,0x31}},
115 sizeof(mstru.
m1),
sizeof(mstru.
m2)}},
123 static unsigned char buf[16];
126 assert(NULL == cfg_accepted);
129 static unsigned char buf[1];
133 assert(NULL == cfg_accepted);
136 static unsigned char buf[16];
144 assert(NULL == cfg_accepted);
148 static unsigned char buf[4];
156 assert(NULL == cfg_accepted);
160 static unsigned char buf[255];
168 assert(NULL == cfg_accepted);
172 static unsigned char buf[16];
177 {
R,
HIPC_ERR_IO_READ, 9, {0x43,0x49,0x44,0x5f,0x4d,0x4f,0x43,0x4b,0x31}},
181 assert(NULL == cfg_accepted);
185 static unsigned char buf[16];
194 assert(NULL == cfg_accepted);
198 static unsigned char buf[16];
204 {
R,
S, 9, {0x43,0x49,0x44,0x5f,0x4d,0x4f,0x43,0x4b,0x31}},
208 assert(NULL == cfg_accepted);
212 static unsigned char buf[16];
217 {
R,
S, 9, {0x43,0x49,0x44,0x5f,0x4d,0x4f,0x43,0x4b,0x31}},
222 assert(HIPC_ERR_IO_WRITE==
hipcUsocAccept(&usoc, &cfg_accepted, cfg_ary, 1, buf,
sizeof(buf)));
254 sizeof(mstru.
m1),
sizeof(mstru.
m2)}},
333 assert(HIPC_ERR_IO_WRITE ==
341 int main(
int argc,
char *argv[])
344 fprintf(stderr,
"Usage: %s test_id\n", argv[0]);
348 switch (argv[1][0]) {
359 fprintf(stderr,
"Invalid test_id: %s \n", argv[1]);
enum HIPC_errno hipcUsocAcceptSimple(struct HIPC_usoc *const so_p, const struct HIPC_scfg *const cfg_p)
Accepts a HIPC session of cfg_p.
const struct HIPC_scfg HIPCUD_cfgmock1_SCFG
#define HIPCUD_cfgmock1_CFGID_SIZE
enum HIPC_errno hipcUsocWriteMsgd(struct HIPC_usoc *const so_p, hipc_msgd const *const md_p)
Writes md_p to so_p.
int main(int argc, char *argv[])
int mockIOCheckCompletion(struct MockIO *mio_p)
#define hipcGenmdQuit(md_p, hipc_errno, errdtlstr)
Initializes a HIPC message data as a QUIT message.
#define hipcGenmdSuccess(md_p)
Initializes a HIPC message data as a SUCCESS message.
const struct HIPC_scfg HIPCUD_cfgmock2_SCFG
enum HIPC_errno hipcUsocRead(struct HIPC_usoc *so_p, void *buf, const size_t size)
Reads exactly size bytes from so_p.
enum HIPC_errno hipcUsocWrite(struct HIPC_usoc *so_p, const void *buf, const size_t size)
Writes exactly size bytes to so_p.
void mockIOInit(struct MockIO *mio_p, const struct MockIOOp *ops, const unsigned int nops)
enum HIPC_errno mockIOWrite(struct MockIO *mio_p, const void *buf, const size_t size)
enum HIPC_errno hipcUsocAccept(struct HIPC_usoc *const so_p, const struct HIPC_scfg **const cfg_pp, const struct HIPC_scfg *const *const cfg_ary, const unsigned int n_cfg, unsigned char *const buf, size_t buf_size)
Accepts a HIPC session if cfg_ary includes a configuration of coming HELLO message.
enum HIPC_errno mockIORead(struct MockIO *mio_p, void *buf, const size_t size)
static void test_hipcUsocWriteMsgd(void)
static void test_hipcUsocAccept(void)
static void test_hipcUsocAcceptSimple(void)