Skip to content

Commit

Permalink
cxxxrtl: fix use of format specifiers in test
Browse files Browse the repository at this point in the history
This fix a few instances of incorrect (and non-portable) use of format
specifiers.
  • Loading branch information
maribu authored and whitequark committed Jun 11, 2024
1 parent ef90458 commit 7f89a45
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/cxxrtl/test_value_fuzz.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <cinttypes>
#include <cstddef>
#include <cstdint>
#include <cstdio>
Expand Down Expand Up @@ -62,17 +63,17 @@ void test_binary_operation_for_bitsize(Operation &op)
for (size_t i = 0; i * chunk_bits < Bits; i++) {
if ((chunk_type)(iresult >> (i * chunk_bits)) != vresult.data[i]) {
std::printf("Test failure:\n");
std::printf("Bits: %i\n", Bits);
std::printf("a: %016lx\n", ia);
std::printf("b: %016lx\n", ib);
std::printf("iresult: %016lx\n", iresult);
std::printf("vresult: %016lx\n", vresult.template get<uint64_t>());
std::printf("Bits: %zu\n", Bits);
std::printf("a: %016" PRIx64 "\n", ia);
std::printf("b: %016" PRIx64 "\n", ib);
std::printf("iresult: %016" PRIx64 "\n", iresult);
std::printf("vresult: %016" PRIx64 "\n", vresult.template get<uint64_t>());

std::terminate();
}
}
}
std::printf("Test passed @ Bits = %i.\n", Bits);
std::printf("Test passed @ Bits = %zu.\n", Bits);
}

template<typename Operation>
Expand Down

0 comments on commit 7f89a45

Please sign in to comment.