From: Andrew Morton <akpm@linux-foundation.org>
To: Andrea Righi <arighi@develer.com>
Cc: Stefani Seibold <stefani@seibold.net>,
Greg Kroah-Hartman <gregkh@suse.de>,
Mauro Carvalho Chehab <mchehab@redhat.com>,
Andi Kleen <ak@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] kfifo: add kfifo_skip() testcase
Date: Thu, 12 Aug 2010 14:22:11 -0700 [thread overview]
Message-ID: <20100812142211.59e24462.akpm@linux-foundation.org> (raw)
In-Reply-To: <1281627158-9461-2-git-send-email-arighi@develer.com>
On Thu, 12 Aug 2010 17:32:38 +0200
Andrea Righi <arighi@develer.com> wrote:
> Add a testcase for kfifo_skip() to the byte stream fifo example.
>
> Signed-off-by: Andrea Righi <arighi@develer.com>
> ---
> samples/kfifo/bytestream-example.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/samples/kfifo/bytestream-example.c b/samples/kfifo/bytestream-example.c
> index 642eef3..2e3a7a8 100644
> --- a/samples/kfifo/bytestream-example.c
> +++ b/samples/kfifo/bytestream-example.c
> @@ -73,6 +73,10 @@ static int __init testfunc(void)
> ret = kfifo_in(&test, buf, ret);
> printk(KERN_INFO "ret: %d\n", ret);
>
> + /* skip first element of the fifo */
> + printk(KERN_INFO "skip 1st element\n");
> + kfifo_skip(&test);
> +
> /* put values into the fifo until is full */
> for (i = 20; kfifo_put(&test, &i); i++)
> ;
hm, that's not a very good test harness. A better one would check that
the resulting kfifo actually contains the expected items in the
expected order. AFACIT this will "pass" even if kfifo_skip() is a
no-op, or execs nethack or something.
Oh well, it's more than we usually get.
next prev parent reply other threads:[~2010-08-12 21:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-12 15:32 [PATCH 1/2] kfifo: implement missing __kfifo_skip_r() Andrea Righi
2010-08-12 15:32 ` [PATCH 2/2] kfifo: add kfifo_skip() testcase Andrea Righi
2010-08-12 20:46 ` Stefani Seibold
2010-08-12 21:22 ` Andrew Morton [this message]
2010-08-12 22:28 ` Andrea Righi
2010-08-12 20:45 ` [PATCH 1/2] kfifo: implement missing __kfifo_skip_r() Stefani Seibold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100812142211.59e24462.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=ak@linux.intel.com \
--cc=arighi@develer.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@redhat.com \
--cc=stefani@seibold.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox