[HUST CSE][utest] fix the sizeof incorrect calculation
atoi_tc.c中的"sizeof(test_data[0])" 和atol_tc.c中的"sizeof(test_data1[0]"错误,小于实际数组中的数据个数
This commit is contained in:
parent
92a253c88f
commit
9a77eedd89
|
@ -47,7 +47,7 @@ int atoi_entry(void)
|
|||
{
|
||||
int i = 0;
|
||||
int res = 0;
|
||||
for (i = 0; i < sizeof(test_data[0]); i++)
|
||||
for (i = 0; i < sizeof(test_data) / sizeof(test_data[0]); i++)
|
||||
{
|
||||
res = atoi(test_data[i].string);
|
||||
uassert_int_equal(res, test_data[i].ret_num);
|
||||
|
|
|
@ -49,7 +49,7 @@ int atol_entry(void)
|
|||
{
|
||||
int i = 0;
|
||||
int res = 0;
|
||||
for (i = 0; i < sizeof(test_data1[0]); i++)
|
||||
for (i = 0; i < sizeof(test_data1) / sizeof(test_data1[0]); i++)
|
||||
{
|
||||
res = atol(test_data1[i].string);
|
||||
uassert_int_equal(res, test_data1[i].ret_num);
|
||||
|
|
Loading…
Reference in New Issue