Skip to content

Commit

Permalink
tests/checkasm/lpc: correct arithmetic when randomizing buffers
Browse files Browse the repository at this point in the history
Results weren't signed.
  • Loading branch information
cyanreg committed Sep 22, 2022
1 parent 6ad39f0 commit 668f43a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/checkasm/lpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@

#include "checkasm.h"

#define randomize_int32(buf, len) \
do { \
for (int i = 0; i < len; i++) { \
int32_t f = (UINT32_MAX >> 8) - (rnd() >> 16); \
buf[i] = f; \
} \
#define randomize_int32(buf, len) \
do { \
for (int i = 0; i < len; i++) { \
int32_t f = ((int)(UINT32_MAX >> 17)) - ((int)(rnd() >> 16)); \
buf[i] = f; \
} \
} while (0)

#define EPS 0.005
Expand Down

0 comments on commit 668f43a

Please sign in to comment.