Skip to content

tests: add sprandom test cases#1983

Merged
axboe merged 1 commit intoaxboe:masterfrom
tomas-winkler-sndk:sprandom-tests
Sep 18, 2025
Merged

tests: add sprandom test cases#1983
axboe merged 1 commit intoaxboe:masterfrom
tomas-winkler-sndk:sprandom-tests

Conversation

@tomas-winkler-sndk
Copy link
Copy Markdown
Contributor

Add 5 simple sprandom tests. These currently verify that the feature
does not break under normal use and properly handles invalid arguments.

@sitsofe
Copy link
Copy Markdown
Collaborator

sitsofe commented Sep 17, 2025

@tomas-winkler-sndk :
I just happened to do a build on an old Linux install with

LDFLAGS="-m32" ./configure --disable-native --extra-cflags="-m32 -march=i386" && make

and it generated the following warnings:

In file included from fio.h:23:0,
                 from sprandom.c:10:
sprandom.c: In function ‘print_d_array’:
log.h:24:12: warning: the comparison will always evaluate as ‘true’ for the address of ‘out’ will never be NULL [-Waddress]
  if ((buf) != NULL)    \
            ^
sprandom.c:123:2: note: in expansion of macro ‘log_buf’
  log_buf(&out, "[");
  ^~~~~~~
log.h:24:12: warning: the comparison will always evaluate as ‘true’ for the address of ‘out’ will never be NULL [-Waddress]
  if ((buf) != NULL)    \
            ^
sprandom.c:125:3: note: in expansion of macro ‘log_buf’
   log_buf(&out, "%.2f, ", darray[i]);
   ^~~~~~~
log.h:24:12: warning: the comparison will always evaluate as ‘true’ for the address of ‘out’ will never be NULL [-Waddress]
  if ((buf) != NULL)    \
            ^
sprandom.c:127:2: note: in expansion of macro ‘log_buf’
  log_buf(&out, "%.2f]\n", darray[len - 1]);
  ^~~~~~~
sprandom.c: In function ‘print_d_points’:
log.h:24:12: warning: the comparison will always evaluate as ‘true’ for the address of ‘out’ will never be NULL [-Waddress]
  if ((buf) != NULL)    \
            ^
sprandom.c:142:2: note: in expansion of macro ‘log_buf’
  log_buf(&out, "[");
  ^~~~~~~
log.h:24:12: warning: the comparison will always evaluate as ‘true’ for the address of ‘out’ will never be NULL [-Waddress]
  if ((buf) != NULL)    \
            ^
sprandom.c:144:3: note: in expansion of macro ‘log_buf’
   log_buf(&out, "(%.2f %.2f), ", parray[i].x, parray[i].y);
   ^~~~~~~
log.h:24:12: warning: the comparison will always evaluate as ‘true’ for the address of ‘out’ will never be NULL [-Waddress]
  if ((buf) != NULL)    \
            ^
sprandom.c:146:2: note: in expansion of macro ‘log_buf’
  log_buf(&out, "(%.2f %.2f)]\n", parray[len - 1].x, parray[len - 1].y);
  ^~~~~~~

Any ideas?

Copy link
Copy Markdown
Collaborator

@vincentkfu vincentkfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just drop this patch? It does not seem related to sprandom. What is liat? There should be an explanation for the changes as well.

Add 5 simple sprandom tests. These currently verify that the feature
does not break under normal use and properly handles invalid arguments.

Signed-off-by: Tomas Winkler <tomas.winkler@sandisk.com>
@tomas-winkler-sndk
Copy link
Copy Markdown
Contributor Author

Let's just drop this patch? It does not seem related to sprandom. What is liat? There should be an explanation for the changes as well.
Dropped, that leftover patch.

@axboe axboe merged commit f5a5f44 into axboe:master Sep 18, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants