Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address competition warnings fix in integer tests #182

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions tests/tests-skeletons/check-INTEGER.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <assert.h>

#include <asn_application.h>
#include <asn_system.h>
#include <INTEGER.h>

#define CHECK_XER(a,b,c) check_xer(__LINE__, a, b, c)
Expand Down Expand Up @@ -170,10 +171,10 @@ check_64(uint8_t *buf, size_t size, int64_t check_i64, int check_ret) {
printf("]: ");

ret = asn_INTEGER2int64(&val, &rint64);
printf(" (%lld, %d) vs (%lld, %d)\n",
printf(" (%"ASN_PRIdMAX", %d) vs (%"ASN_PRIdMAX", %d)\n",
rint64, ret, check_i64, check_ret);
assert(ret == check_ret);
printf("%lld %lld\n", rint64, check_i64);
printf("%"ASN_PRIdMAX" %"ASN_PRIdMAX"\n", rint64, check_i64);
assert(rint64 == check_i64);

if(check_ret == 0) {
Expand All @@ -195,7 +196,7 @@ check_64(uint8_t *buf, size_t size, int64_t check_i64, int check_ret) {
ret = INTEGER_print(&asn_DEF_INTEGER, &val, 0, _print2buf, scratch);
assert(shared_scratch_start < scratch + sizeof(scratch));
assert(ret == 0);
ret = snprintf(verify, sizeof(verify), "%lld", check_i64);
ret = snprintf(verify, sizeof(verify), "%"ASN_PRIdMAX"", check_i64);
assert(ret < 0 || (size_t)ret < sizeof(verify));
ret = strcmp(scratch, verify);
printf(" [%s] vs [%s]: %d%s\n",
Expand Down Expand Up @@ -232,7 +233,7 @@ check_unsigned_64(uint8_t *buf, int size, uint64_t check_u64, int check_ret) {
printf("]: ");

ret = asn_INTEGER2uint64(&val, &ruint64);
printf(" (%llu, %d) vs (%llu, %d)\n",
printf(" (%"ASN_PRIuMAX", %d) vs (%"ASN_PRIuMAX", %d)\n",
ruint64, ret, check_u64, check_ret);
assert(ret == check_ret);
assert(ruint64 == check_u64);
Expand Down Expand Up @@ -263,7 +264,7 @@ check_unsigned_64(uint8_t *buf, int size, uint64_t check_u64, int check_ret) {
ret = INTEGER_print(&asn_DEF_INTEGER, &val, 0, _print2buf, scratch);
assert(shared_scratch_start < scratch + sizeof(scratch));
assert(ret == 0);
ret = snprintf(verify, sizeof(verify), "%llu", check_u64);
ret = snprintf(verify, sizeof(verify), "%"ASN_PRIuMAX"", check_u64);
assert(ret < (int)sizeof(verify));
ret = strcmp(scratch, verify);
printf(" [%s] vs [%s]: %d%s\n",
Expand Down
Loading