Skip to content

Commit 598613e

Browse files
committed
tests / test_test_util: int types clean-up.
1 parent 6b8ced7 commit 598613e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/test_test_util.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ END_TEST
1414
START_TEST ( test_filesize2datablocks )
1515
{
1616
static const struct testdata_s {
17-
int fsize,
17+
unsigned fsize,
1818
result488,
1919
result512;
2020
} testdata [] = {
@@ -36,7 +36,7 @@ START_TEST ( test_filesize2datablocks )
3636
for ( unsigned i = 0 ; i < ntests ; ++i ) {
3737
//ck_assert_int_eq ( filesize2datablocks ( testdata[i].fsize, 488 ),
3838
// testdata[i].result488 );
39-
int dblocks = filesize2datablocks ( testdata[i].fsize, 488 );
39+
unsigned dblocks = filesize2datablocks ( testdata[i].fsize, 488 );
4040
ck_assert_msg ( dblocks == testdata[i].result488,
4141
"datablocks incorrect: %d, expected %d, blocksize %d",
4242
dblocks, testdata[i].result488, testdata[i].fsize );
@@ -55,8 +55,8 @@ END_TEST
5555
START_TEST ( test_datablocks2extblocks )
5656
{
5757
static const struct testdata_s {
58-
int datablocks,
59-
result;
58+
unsigned datablocks,
59+
result;
6060
} testdata [] = {
6161
{ 0, 0 },
6262
{ 1, 0 },
@@ -69,7 +69,7 @@ START_TEST ( test_datablocks2extblocks )
6969
};
7070
static const unsigned ntests = sizeof ( testdata ) / sizeof ( struct testdata_s );
7171
for ( unsigned i = 0 ; i < ntests ; ++i ) {
72-
int extblocks = datablocks2extblocks ( testdata[i].datablocks );
72+
unsigned extblocks = datablocks2extblocks ( testdata[i].datablocks );
7373
ck_assert_msg ( extblocks == testdata[i].result,
7474
"ext. blocks incorrect: %d, expected %d, datablocks %d",
7575
extblocks, testdata[i].result, testdata[i].datablocks );
@@ -81,7 +81,7 @@ END_TEST
8181
START_TEST ( test_filesize2blocks )
8282
{
8383
static const struct testdata_s {
84-
int fsize,
84+
unsigned fsize,
8585
result488,
8686
result512;
8787
} testdata [] = {
@@ -115,7 +115,7 @@ START_TEST ( test_filesize2blocks )
115115
};
116116
static const unsigned ntests = sizeof ( testdata ) / sizeof ( struct testdata_s );
117117
for ( unsigned i = 0 ; i < ntests ; ++i ) {
118-
int nblocks = filesize2blocks ( testdata[i].fsize, 488 );
118+
unsigned nblocks = filesize2blocks ( testdata[i].fsize, 488 );
119119
ck_assert_msg ( nblocks == testdata[i].result488,
120120
"blocks incorrect: %d, expected %d, blocksize %d",
121121
nblocks, testdata[i].result488, testdata[i].fsize );
@@ -132,8 +132,8 @@ END_TEST
132132
START_TEST ( test_datablocks2posInExtBlk )
133133
{
134134
static const struct testdata_s {
135-
int datablock_idx,
136-
result;
135+
unsigned datablock_idx,
136+
result;
137137
} testdata [] = {
138138
//{ 0, -1 },
139139
//{ 1, -1 },
@@ -163,7 +163,7 @@ START_TEST ( test_datablocks2posInExtBlk )
163163
};
164164
static const unsigned ntests = sizeof ( testdata ) / sizeof ( struct testdata_s );
165165
for ( unsigned i = 0 ; i < ntests ; ++i ) {
166-
int posInExtBlk = datablock2posInExtBlk ( testdata[i].datablock_idx );
166+
unsigned posInExtBlk = datablock2posInExtBlk ( testdata[i].datablock_idx );
167167
ck_assert_msg ( posInExtBlk == testdata[i].result,
168168
"pos in ext. block incorrect: %d, expected %d, datablocks %d",
169169
posInExtBlk, testdata[i].result, testdata[i].datablock_idx );

0 commit comments

Comments
 (0)