21 #include "CUnit/CUnit.h" 39 char *Sin =
"hello name=larry, very good";
45 char *predictValue =
"name=larry, very good";
48 CU_ASSERT_TRUE(!strcmp(Result, predictValue));
66 char *predictValue = NULL;
69 CU_ASSERT_EQUAL(Result, predictValue);
81 char *Sin =
"name=larry, very good";
86 char *predictField =
"name";
87 char *predictValue =
"=larry, very good";
88 char Separator =
'\0';
91 CU_ASSERT_TRUE(!strcmp(Result, predictValue));
92 CU_ASSERT_TRUE(!strcmp(Field, predictField));
CU_TestInfo testcases_GetFieldValue[]
testcases for function GetFieldValue
static int Result
Result of calls.
char * GetFieldValue(char *Sin, char *Field, int FieldMax, char *Value, int ValueMax)
Given a string that contains field='value' pairs, save the items.
void test_GetFieldValue_sin_is_null()
test case for input parameter is NULL
void test_GetFieldValue_noseparator()
test case for don't set input separator
void test_GetFieldValue_normal()
test case for input parameter is normal