From: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
To: ltp-list@lists.sourceforge.net
Subject: [LTP] [PATCH] chdir/chdir01.c: Add ELOOP error number test
Date: Mon, 28 Oct 2013 09:32:06 +0800 [thread overview]
Message-ID: <526DBE96.1060902@cn.fujitsu.com> (raw)
Add ELOOP error number test in chdir01.c for chdir(2)
Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
---
testcases/kernel/syscalls/chdir/chdir01.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/syscalls/chdir/chdir01.c b/testcases/kernel/syscalls/chdir/chdir01.c
index 04fb8b4..c4e74fb 100644
--- a/testcases/kernel/syscalls/chdir/chdir01.c
+++ b/testcases/kernel/syscalls/chdir/chdir01.c
@@ -59,9 +59,9 @@
#include "safe_macros.h"
char *TCID = "chdir01";
-int TST_TOTAL = 1;
+int TST_TOTAL = 2;
-int exp_enos[] = { ENOTDIR, 0 };
+int exp_enos[] = { ENOTDIR, ELOOP, 0 };
void setup(void);
void cleanup(void);
@@ -120,6 +120,23 @@ int main(int ac, char **av)
SAFE_CHDIR(cleanup, "..");
+ /* ELOOP */
+ SAFE_SYMLINK(cleanup, "test_eloop1", "test_eloop2");
+ SAFE_SYMLINK(cleanup, "test_eloop2", "test_eloop1");
+
+ TEST(chdir("test_eloop1"));
+
+ if (TEST_RETURN != -1) {
+ tst_resm(TFAIL, "call succeeded unexpectedly");
+ } else if (TEST_ERRNO != ELOOP) {
+ tst_resm(TFAIL | TTERRNO,
+ "failed unexpectedly; wanted ELOOP");
+ } else {
+ tst_resm(TPASS, "failed as expected with ELOOP");
+ }
+
+ SAFE_UNLINK(cleanup, "test_eloop1");
+ SAFE_UNLINK(cleanup, "test_eloop2");
}
cleanup();
--
1.8.2.1
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next reply other threads:[~2013-10-28 1:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-28 1:32 Zeng Linggang [this message]
2013-10-31 2:01 ` [LTP] [PATCH] chdir/chdir01.c: Add ELOOP error number test Wanlong Gao
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=526DBE96.1060902@cn.fujitsu.com \
--to=zenglg.jy@cn.fujitsu.com \
--cc=ltp-list@lists.sourceforge.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