|
int LINE_C_CTL( struct LINE_C_WORK *wk , int event )
{
int func_no , ret, old_sts;
event_bak = event;
func_no = line_c_matrix_tbl[event][wk->sts];
old_sts = wk->sts;
dbg_print(" >>>>> (%d)line_c_matrix_tbl[ev=%d][sts=%d] -> mtx%02d\n" ,
wk->no, event, wk->sts, func_no ); /* VR12-V2.0-ccl-011 C */
ret = line_c_matrix_funcs[ func_no ] ( wk );
if (old_sts != wk->sts)
dbg_print(" >>>>> (%d)line_c_mtx%02d done : now sts=%d\n" ,
wk->no, func_no , wk->sts ); /* VR12-V2.0-ccl-011 C */
return ret;
}
上面是被测函数
int (* const line_c_matrix_funcs[])(struct LINE_C_WORK *) = {
line_c_mtx00 , line_c_mtx01 , line_c_mtx02 , line_c_mtx03 ,
line_c_mtx04 , line_c_mtx05 , line_c_mtx06 , line_c_mtx07 ,
line_c_mtx08 , line_c_mtx09 , line_c_mtx10 , line_c_mtx11 ,
line_c_mtx12 , line_c_mtx13 , line_c_mtx14 ,
line_c_mtx15 , line_c_mtx16 , line_c_mtx17 , line_c_mtx18
};
line_c_mtx00~line_c_mtx18都是函数名,其实整个被测函数的意思就是:根据不同的输入,来调用不同的函数。可这19个函数虽然处理过程不一样,可它们的return都是0,这使得不管调用哪个函数,被测函数里的ret值始终为0。
这函数该如何写testcase? |
|