void test_ xxx_driver (void) // ????xxx????????
{
typedef struct _TEST_CASE // ????????????
{
UINT8* pBuf; //??д?????????
int len; //??д???????
STATUS result; // ????????OK??ERROR
} TESTCASE;
#define TEST_NUM 4 // ??????????
UINT8* rBuf;
TESTCASE testCase[TEST_NUM]={
{0??DATA_MAX_LEN+1??ERROR}?? // DATA_MAX_LEN??????д?????
{"a"??1??OK}??
{"12"??2??OK}??
{0??DATA_MAX_LEN??OK}
};
for (int i=0;i< TEST_NUM;i++)
{
if(write(testCase[i].pBuf??testCase[i].len) != testCase[i].result) // д????
LOG ("test write failed!");
if(read(rBuf??testCase[i].len) != testCase[i].result) // ??????
LOG ("test read failed! ");
if(bcmp(testCase[i].pBuf??rBuf??testCase[i].len) != 0) // ????д????
LOG ("compare data failed! ");
}
}