Skip to content

Commit

Permalink
Tests: Use more appropriate types in compare/assert.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/apr/apr-util/branches/1.7.x@1920631 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Ivan Zhakov committed Sep 14, 2024
1 parent 86c38e8 commit 2a8b702
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions test/testbuckets.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,9 @@ static void test_iovec(abts_case *tc, void *data)

ABTS_INT_EQUAL(tc, 2, vecs);
ABTS_STR_EQUAL(tc, "foo", vec[0].iov_base);
ABTS_INT_EQUAL(tc, 3, vec[0].iov_len);
ABTS_SIZE_EQUAL(tc, 3, vec[0].iov_len);
ABTS_STR_EQUAL(tc, "bar", vec[1].iov_base);
ABTS_INT_EQUAL(tc, 3, vec[1].iov_len);
ABTS_SIZE_EQUAL(tc, 3, vec[1].iov_len);

apr_brigade_destroy(bb);
apr_bucket_alloc_destroy(ba);
Expand Down
4 changes: 2 additions & 2 deletions test/testdbm.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ static void test_dbm_fetch(abts_case *tc, apr_dbm_t *db, dbm_table_t *table)
rv = apr_dbm_fetch(db, table[i].key, &val);
if (!table[i].deleted) {
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
ABTS_INT_EQUAL(tc, table[i].val.dsize, val.dsize);
ABTS_SIZE_EQUAL(tc, table[i].val.dsize, val.dsize);
ABTS_INT_EQUAL(tc, 0, memcmp(table[i].val.dptr, val.dptr, val.dsize));
apr_dbm_freedatum(db, val);
} else {
ABTS_INT_EQUAL(tc, 0, val.dsize);
ABTS_SIZE_EQUAL(tc, 0, val.dsize);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions test/testjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ static void test_json_identity(abts_case * tc, void *data)

ABTS_STR_NEQUAL(tc, src, buf, len);

ABTS_INT_EQUAL(tc, len, offset);
ABTS_ULLONG_EQUAL(tc, len, offset);
ABTS_INT_EQUAL(tc, APR_JSON_OBJECT, json->type);
image = apr_hash_get(json->value.object->hash, "Image", 5);
ABTS_PTR_NOTNULL(tc, image);
width = apr_hash_get(image->v->value.object->hash, "Width", 5);
ABTS_PTR_NOTNULL(tc, width);
ABTS_INT_EQUAL(tc, APR_JSON_LONG, width->v->type);
ABTS_INT_EQUAL(tc, 800, width->v->value.lnumber);
ABTS_LLONG_EQUAL(tc, 800, width->v->value.lnumber);
ids = apr_hash_get(image->v->value.object->hash, "IDs", 3);
ABTS_PTR_NOTNULL(tc, ids);
ABTS_INT_EQUAL(tc, APR_JSON_ARRAY, ids->v->type);
Expand All @@ -85,7 +85,7 @@ static void test_json_identity(abts_case * tc, void *data)
height = apr_hash_get(image->v->value.object->hash, "Height", 6);
ABTS_PTR_NOTNULL(tc, height);
ABTS_INT_EQUAL(tc, APR_JSON_LONG, height->v->type);
ABTS_INT_EQUAL(tc, 600, height->v->value.lnumber);
ABTS_LLONG_EQUAL(tc, 600, height->v->value.lnumber);

}

Expand Down
2 changes: 1 addition & 1 deletion test/testmd4.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static void test_md4sum(abts_case *tc, void *data)
unsigned char digest[APR_MD4_DIGESTSIZE];
const void *string = md4sums[count].string;
const void *sum = md4sums[count].md4sum;
unsigned int len = strlen(string);
size_t len = strlen(string);

ABTS_ASSERT(tc, "apr_md4_init", (apr_md4_init(&context) == 0));
ABTS_ASSERT(tc, "apr_md4_update",
Expand Down
2 changes: 1 addition & 1 deletion test/testmd5.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static void test_md5sum(abts_case *tc, void *data)
unsigned char digest[APR_MD5_DIGESTSIZE];
const void *string = md5sums[count].string;
const void *sum = md5sums[count].digest;
unsigned int len = strlen(string);
size_t len = strlen(string);

ABTS_ASSERT(tc, "apr_md5_init", (apr_md5_init(&context) == 0));
ABTS_ASSERT(tc, "apr_md5_update",
Expand Down

0 comments on commit 2a8b702

Please sign in to comment.