12 assert(0 == strcspn(
"",
""));
13 assert(0 == strcspn(
"",
"a"));
14 assert(1 == strcspn(
"a",
""));
15 assert(0 == strcspn(
"",
"abc"));
16 assert(3 == strcspn(
"abc",
""));
17 assert(0 == strcspn(
"a",
"abc"));
18 assert(0 == strcspn(
"abc",
"a"));
19 assert(1 == strcspn(
"abc",
"b"));
20 assert(2 == strcspn(
"abc",
"c"));
21 assert(3 == strcspn(
"abc",
"x"));
23 assert(8 == strcspn(
"test_ctl.enable",
"."));
37 assert(
sizeof(sary[0]) == 5 *
sizeof(sary[0][0]));
38 assert(
sizeof(sary) == 3 * 5 *
sizeof(sary[0][0]));
40 assert(
sizeof(bary[0]) == 9 *
sizeof(bary[0][0]));
41 assert(
sizeof(bary) == 7 * 9 *
sizeof(bary[0][0]));
75 {2,
"test_ctl", b_test_ctl},
77 {3,
"pid_ctrl", HIPCUD_pidctrl_indp_member_pid_ctrl},
138 unsigned char strctnum;
144 &strctnum, &offset, &size));
148 &strctnum, &offset, &size));
150 strcmp(
"Number of dimensions is zero: mbr_p->ary_dim is zero",
155 &strctnum, &offset, &size));
156 assert(0 == strcmp(
"Invalid member type: invalid value in mbr_p->type",
161 &strctnum, &offset, &size));
162 assert(0 == strctnum);
166 &strctnum, &offset, &size));
167 assert(0 == strctnum);
173 &strctnum, &offset, &size));
174 assert(0 == strcmp(
"Unknown structure name: test_foo",
180 assert(1 == strctnum);
186 &strctnum, &offset, &size));
187 assert(1 == strctnum);
193 &strctnum, &offset, &size));
194 assert(0 == strcmp(
"Failed to extract index from: [x]",
199 "sa.ary0[18446744073709551616]",
200 &strctnum, &offset, &size));
202 strcmp(
"Failed to extract index from: [18446744073709551616]",
207 &strctnum, &offset, &size));
208 assert(1 == strctnum);
213 &strctnum, &offset, &size));
214 assert(1 == strctnum);
219 &strctnum, &offset, &size));
220 assert(1 == strctnum);
221 assert(18 == offset);
226 &strctnum, &offset, &size));
232 &strctnum, &offset, &size));
234 strcmp(
"No left bracket following the array name: .1]",
239 &strctnum, &offset, &size));
241 strcmp(
"No right bracket following the index number: [1[2]",
246 &strctnum, &offset, &size));
247 assert(1 == strctnum);
248 assert(10 == offset);
253 &strctnum, &offset, &size));
254 assert(1 == strctnum);
255 assert(10 == offset);
260 &strctnum, &offset, &size));
261 assert(0 == strcmp(
"Inappropriate string: [0]", b_ri.
err_detail_str));
264 &strctnum, &offset, &size));
265 assert(0 == strcmp(
"Inappropriate string: foo", b_ri.
err_detail_str));
269 &strctnum, &offset, &size));
270 assert(1 == strctnum);
271 assert(24 == offset);
277 assert(1 == strctnum);
278 assert(40 == offset);
284 assert(1 == strctnum);
285 assert(44 == offset);
290 &strctnum, &offset, &size));
292 strcmp(
"No period before the member name: diff",
297 &strctnum, &offset, &size));
298 assert(0 == strcmp(
"Unknown member name: foo", b_ri.
err_detail_str));
303 assert(2 == strctnum);
317 unsigned char strctnum;
323 buf[HIPC_IMG_ALLOCSIZE + 1] =
'\0';
327 assert(0 == memcmp(
"Unknown structure name: ", str, 24));
328 for (i = 24; i < HIPC_IMG_ALLOCSIZE - 1; ++i) {
329 assert(
'a' == str[i]);
331 assert(
'\0' == str[HIPC_IMG_ALLOCSIZE - 1]);
336 for (i = 3; i < HIPC_IMG_ALLOCSIZE + 3; ++i) {
339 buf[HIPC_IMG_ALLOCSIZE + 3] =
'\0';
343 assert(0 == memcmp(
"Unknown member name: ", str, 21));
344 for (i = 21; i < HIPC_IMG_ALLOCSIZE - 1; ++i) {
345 assert(
'a' == str[i]);
347 assert(
'\0' == str[HIPC_IMG_ALLOCSIZE - 1]);
352 int main(
int argc,
char *argv[])
355 fprintf(stderr,
"Usage: %s test_id\n", argv[0]);
359 switch (argv[1][0]) {
371 fprintf(stderr,
"Invalid test_id: %s \n", argv[1]);
unsigned char b_smdp_strctsizes[]
struct HIPC_cl_dp_stru b_cmdp_s[]
Machine-dependent information of a structure used in a client.
int main(int argc, char *argv[])
Machine-independent information of a member of a structure used in a client.
Machine-independent information of a client.
const struct HIPC_cl_indp_mbr HIPCUD_pidctrl_indp_member_pid_ctrl[]
#define HIPC_IMG_ALLOCSIZE
unsigned char HIPCUD_pidctrl_smdp_pid_ctrl_offset[]
unsigned char HIPCUD_pidctrl_cmdp_pid_ctrl_size[]
char err_detail_str[HIPC_IMG_ALLOCSIZE]
const size_t b_ary1_elm_max_idxs[]
const char * hipcClientGetErrDtlStr(const struct HIPC_client *const cl_p)
Gets a string describing details of an error that has been set to a HIPC client.
struct HIPC_cl_dp_stru b_smdp_s[]
Machine-independent information of a structure used in a client.
unsigned char b_test_sa_offset[]
unsigned char HIPCUD_pidctrl_smdp_pid_ctrl_size[]
unsigned char b_inv_size[]
static void test_arysize(void)
const size_t b_inv_elm_max_idxs[]
static void test_hipcClientGetStrutpl_tooLargeName(void)
const struct HIPC_cl_indp_mbr b_test_sa[]
unsigned char b_cmdp_strctsizes[]
const struct HIPC_cl_indp_mbr b_inv[]
const struct HIPC_cl_indp_mbr b_test_ctl[]
enum HIPC_errno hipcClientGetStrutpl(struct HIPC_client *const cl_p, char const *const str, unsigned char *struno_p, size_t *offset_p, size_t *size_p)
Gets structure number, offset, and size from ID string.
const struct HIPC_cl_indp_stru b_indp_s[]
unsigned char HIPCUD_pidctrl_cmdp_pid_ctrl_offset[]
const struct HIPC_cl_indp b_indp
unsigned char b_test_ctl_size[]
Machine-dependent information of a client.
unsigned char b_test_sa_size[]
const size_t b_ary0_elm_max_idxs[]
static void test_hipcClientGetStrutpl(void)
unsigned char b_test_ctl_offset[]
static void test_strcspn(void)
unsigned char b_inv_offset[]