Message ID | 20210512101738.31118-1-rpalethorpe@suse.com |
---|---|
State | Accepted |
Headers | show |
Series | API: Give user hint when checkpoints were not initialised | expand |
Hi! > --- > lib/tst_checkpoint.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/lib/tst_checkpoint.c b/lib/tst_checkpoint.c > index 9e9dcf9e6..13d86c73b 100644 > --- a/lib/tst_checkpoint.c > +++ b/lib/tst_checkpoint.c > @@ -86,6 +86,9 @@ int tst_checkpoint_wait(unsigned int id, unsigned int msec_timeout) > struct timespec timeout; > int ret; > > + if (!tst_max_futexes) > + tst_brkm(TBROK, NULL, "Set test.needs_checkpoints = 1"); > + > if (id >= tst_max_futexes) { > errno = EOVERFLOW; > return -1; > @@ -107,7 +110,10 @@ int tst_checkpoint_wake(unsigned int id, unsigned int nr_wake, > { > unsigned int msecs = 0, waked = 0; > > - if (id >= tst_max_futexes) { > + if (!tst_max_futexes) > + tst_brkm(TBROK, NULL, "Set test.needs_checkpoints = 1"); > + > + if (id >= tst_max_futexes) { ^ Spaces instead of tabs... Other than that this looks obviously fine.
Hi Richie, > Currently the user gets an error about EOVERFLOW. This will hopefully > save some searching. Nice! I'm for merging it before release (with that fixed whitespace). Acked-by: Petr Vorel <pvorel@suse.cz> Kind regards, Petr
Hi! > > Currently the user gets an error about EOVERFLOW. This will hopefully > > save some searching. > > Nice! I'm for merging it before release (with that fixed whitespace). Looks safe enough, I will fix the whitespaces and apply.
Hi, Cyril Hrubis <chrubis@suse.cz> writes: > Hi! >> > Currently the user gets an error about EOVERFLOW. This will hopefully >> > save some searching. >> >> Nice! I'm for merging it before release (with that fixed whitespace). > > Looks safe enough, I will fix the whitespaces and apply. Thanks, but I would not put this in the release. There is no advantage to the end user, only test authors. It can only break the tests from an end user POV.
diff --git a/lib/tst_checkpoint.c b/lib/tst_checkpoint.c index 9e9dcf9e6..13d86c73b 100644 --- a/lib/tst_checkpoint.c +++ b/lib/tst_checkpoint.c @@ -86,6 +86,9 @@ int tst_checkpoint_wait(unsigned int id, unsigned int msec_timeout) struct timespec timeout; int ret; + if (!tst_max_futexes) + tst_brkm(TBROK, NULL, "Set test.needs_checkpoints = 1"); + if (id >= tst_max_futexes) { errno = EOVERFLOW; return -1; @@ -107,7 +110,10 @@ int tst_checkpoint_wake(unsigned int id, unsigned int nr_wake, { unsigned int msecs = 0, waked = 0; - if (id >= tst_max_futexes) { + if (!tst_max_futexes) + tst_brkm(TBROK, NULL, "Set test.needs_checkpoints = 1"); + + if (id >= tst_max_futexes) { errno = EOVERFLOW; return -1; }
Currently the user gets an error about EOVERFLOW. This will hopefully save some searching. Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com> --- lib/tst_checkpoint.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)