Skip to content

Commit

Permalink
Fix 64-bit integer testing
Browse files Browse the repository at this point in the history
Signed-off-by: Clayton Smith <[email protected]>
  • Loading branch information
argilo committed Dec 12, 2023
1 parent f210701 commit 4538ce9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/qa_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -490,12 +490,12 @@ bool icompare(t* in1, t* in2, unsigned int vlen, unsigned int tol)
bool fail = false;
int print_max_errs = 10;
for (unsigned int i = 0; i < vlen; i++) {
if (((unsigned int)abs(int(((t*)(in1))[i]) - int(((t*)(in2))[i]))) > tol) {
if (((uint64_t)abs(int64_t(((t*)(in1))[i]) - int64_t(((t*)(in2))[i]))) > tol) {
fail = true;
if (print_max_errs-- > 0) {
std::cout << "offset " << i
<< " in1: " << static_cast<int>(t(((t*)(in1))[i]))
<< " in2: " << static_cast<int>(t(((t*)(in2))[i]));
<< " in1: " << static_cast<int64_t>(t(((t*)(in1))[i]))
<< " in2: " << static_cast<int64_t>(t(((t*)(in2))[i]));
std::cout << " tolerance was: " << tol << std::endl;
}
}
Expand Down

0 comments on commit 4538ce9

Please sign in to comment.