public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Mike Frysinger <vapier@gentoo.org>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] getdents01: don't compare first entry to "."
Date: Fri, 5 Apr 2013 11:08:52 +0200	[thread overview]
Message-ID: <20130405090851.GC18134@rei.Home> (raw)
In-Reply-To: <201304050053.46087.vapier@gentoo.org>

Hi!
> >  	for (lc = 0; TEST_LOOPING(lc); lc++) {
> > -		const char *d_name;
> > -
> >  		tst_count = 0;
> > 
> >  		if ((fd = open(".", O_RDONLY)) == -1)
> > @@ -102,15 +100,7 @@ int main(int ac, char **av)
> >  			continue;
> >  		}
> > 
> > -		if (longsyscall)
> > -			d_name = dirp64->d_name;
> > -		else
> > -			d_name = dirp->d_name;
> > -
> > -		if (strcmp(d_name, "."))
> > -			tst_resm(TFAIL, "First entry is not '.'");
> > -		else
> > -			tst_resm(TPASS, "call succeeded");
> > +		tst_resm(TPASS, "call succeeded");
> > 
> >  		if (close(fd) == -1)
> >  			tst_brkm(TBROK, cleanup, "file close failed");
> 
> this test isn't really useful after your change.  you've basically validated 
> that the a valid fd and a large enough buffer was passed to the kernel and 
> that's it.
> 
> you should have it walk the results to try and find an "." and ".." entry.

Yes, that would be even better. Or we can get even more creative and
create a file or two in the setup and expect them to be in the listing.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  parent reply	other threads:[~2013-04-05  9:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1365125797-31405-1-git-send-email-gaowanlong@cn.fujitsu.com>
2013-04-05  4:53 ` [LTP] [PATCH] getdents01: don't compare first entry to "." Mike Frysinger
     [not found]   ` <1365142365-4089-1-git-send-email-gaowanlong@cn.fujitsu.com>
2013-04-05  9:00     ` [LTP] [PATCH V2] getdents01: compare "." or ".." to the first entry chrubis
2013-04-05  9:08   ` chrubis [this message]
2013-04-15 17:51     ` [LTP] [PATCH] getdents01: don't compare first entry to "." chrubis

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=20130405090851.GC18134@rei.Home \
    --to=chrubis@suse.cz \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=vapier@gentoo.org \
    /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