35 assert(0 == strcmp(
"012", str));
39 assert(0 == strcmp(
"012", str));
43 assert(0 == strcmp(
"abc", str));
47 assert(0 == strcmp(
"012345", str));
51 assert(0 == strcmp(
"01234", str));
55 assert(0 == strcmp(
"0123", str));
59 assert(0 == strcmp(
"012345", str));
63 assert(0 == strcmp(
"012345", str));
67 assert(0 == strcmp(
"012345", str));
79 for (i = 0; i <
sizeof(buf); ++i) {
89 assert(
'a' == str[i]);
91 assert(
'x' == str[HIPC_IMG_ALLOCSIZE - 2]);
92 assert(
'\0' == str[HIPC_IMG_ALLOCSIZE - 1]);
97 for (i = 0; i < HIPC_IMG_ALLOCSIZE - 2; ++i) {
98 assert(
'a' == str[i]);
100 assert(
'x' == str[HIPC_IMG_ALLOCSIZE - 2]);
101 assert(
'\0' == str[HIPC_IMG_ALLOCSIZE - 1]);
103 buf[HIPC_IMG_ALLOCSIZE - 1] =
'\0';
106 for (i = 0; i < HIPC_IMG_ALLOCSIZE - 2; ++i) {
107 assert(
'a' == str[i]);
109 assert(
'x' == str[HIPC_IMG_ALLOCSIZE - 2]);
110 assert(
'\0' == str[HIPC_IMG_ALLOCSIZE - 1]);
114 for (i = 0; i < HIPC_IMG_ALLOCSIZE - 2; ++i) {
115 assert(
'a' == str[i]);
117 assert(
'x' == str[HIPC_IMG_ALLOCSIZE - 2]);
118 assert(
'\0' == str[HIPC_IMG_ALLOCSIZE - 1]);
122 for (i = 0; i < HIPC_IMG_ALLOCSIZE - 2; ++i) {
123 assert(
'a' == str[i]);
125 assert(
'x' == str[HIPC_IMG_ALLOCSIZE - 2]);
126 assert(
'\0' == str[HIPC_IMG_ALLOCSIZE - 1]);
130 for (i = 0; i < HIPC_IMG_ALLOCSIZE - 2; ++i) {
131 assert(
'a' == str[i]);
133 assert(
'x' == str[HIPC_IMG_ALLOCSIZE - 2]);
134 assert(
'\0' == str[HIPC_IMG_ALLOCSIZE - 1]);
136 buf[HIPC_IMG_ALLOCSIZE - 2] =
'\0';
139 for (i = 0; i < HIPC_IMG_ALLOCSIZE - 2; ++i) {
140 assert(
'a' == str[i]);
142 assert(
'\0' == str[HIPC_IMG_ALLOCSIZE - 2]);
143 assert(
'\0' == str[HIPC_IMG_ALLOCSIZE - 1]);
147 for (i = 0; i < HIPC_IMG_ALLOCSIZE - 2; ++i) {
148 assert(
'a' == str[i]);
150 assert(
'A' == str[HIPC_IMG_ALLOCSIZE - 2]);
151 assert(
'\0' == str[HIPC_IMG_ALLOCSIZE - 1]);
155 for (i = 0; i < HIPC_IMG_ALLOCSIZE - 2; ++i) {
156 assert(
'a' == str[i]);
158 assert(
'B' == str[HIPC_IMG_ALLOCSIZE - 2]);
159 assert(
'\0' == str[HIPC_IMG_ALLOCSIZE - 1]);
173 strcmp(
"HIPC_ERR_PROTOCOL_VIOLATION: Protocol violation", str));
175 assert(0 == strcmp(
"NG", str));
180 assert(0 == strcmp(
"HIPC_SUCCESS: No error", str));
182 assert(0 == strcmp(
"", str));
186 assert(0 == strcmp(
"Unknown HIPC errorno value", str));
191 int main(
int argc,
char *argv[])
194 fprintf(stderr,
"Usage: %s test_id\n", argv[0]);
198 switch (argv[1][0]) {
212 fprintf(stderr,
"Invalid test_id: %s \n", argv[1]);
#define HIPC_IMG_ALLOCSIZE
static void test_StdErrno(void)
enum HIPC_errno hipcClientGetHipcErrno(const struct HIPC_client *const cl_p)
Gets a HIPC error number that has been set.
const char * hipcClientGetErrStr(const struct HIPC_client *const cl_p)
Gets a string describing a HIPC error number that has been set to a HIPC client.
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.
int hipcClientGetStdErrno(const struct HIPC_client *const cl_p)
Gets an errno value saved by hipcClientSetStdErrno().
static void test_Err(void)
static void hipcClientSetErrDtlStr(struct HIPC_client *const cl_p, char const *const str0, char const *const str1, size_t ls1)
Sets a string describing details of an error, which will be a concatenation of str0 and str1...
enum HIPC_errno hipcClientSetError(struct HIPC_client *const cl_p, enum HIPC_errno hipc_errno, char const *const str)
Sets an error to a client with error detail.
int main(int argc, char *argv[])
static void test_ErrorDetailStr_longStr(void)
static void test_ErrorDetailStr(void)
void hipcClientSetStdErrno(struct HIPC_client *const cl_p)
Sets errno value to a HIPC client.