|
函数代码如下
void code_int(int x,char *buffer)
{
char *ptr, *start;
int len;
ptr=buffer;
/* go to the end of the buffer */
while (*ptr!=0)
ptr++;
start=ptr;
/* code integer type */
start[0]=UMTS_INTEGER;
ptr++;
/* leave one slot for length */
ptr++;
len=0;
/* Tutorial info
To fix the defect found
Uncomment the following line */
/* if (x==0) {*ptr='0';len++;ptr++;} */
/* take apart the number, a digit at a time */
while (x!=0)
{
*ptr='0'+(x%10);
x=x/10;
ptr++;
len++;
}
/* terminate buffer */
*ptr=(char)0;
/* put the length into the right buffer slot */
start[1]='0'+len;
}
求助高手,讲解下设计的思路,如何才能设计出覆盖率高的测试用例呢?
这是我看到的一个
VAR x, init = 34, ev = init
VAR buffer, init = "", ev = "I243"
剩下的怎么设计??? |
|