All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH]  [PATCH] rmdir/rmdir05: Delete unnecessary if
@ 2015-09-10  1:02 Cui Bixuan
  2015-09-10  1:04 ` Cui Bixuan
  2015-09-10  6:00 ` Zeng Linggang
  0 siblings, 2 replies; 4+ messages in thread
From: Cui Bixuan @ 2015-09-10  1:02 UTC (permalink / raw)
  To: ltp-list; +Cc: zhuyanpeng, zhanyongming

Delete unnecessary if in testcase

Signed-off-by: Cui Bixuan <cuibixuan@huawei.com>
---
 testcases/kernel/syscalls/rmdir/rmdir05.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/testcases/kernel/syscalls/rmdir/rmdir05.c b/testcases/kernel/syscalls/rmdir/rmdir05.c
index 10037c7..2f0f102 100644
--- a/testcases/kernel/syscalls/rmdir/rmdir05.c
+++ b/testcases/kernel/syscalls/rmdir/rmdir05.c
@@ -81,9 +81,6 @@ int main(int argc, char **argv)
 		TEST(rmdir("."));
 
 		if (TEST_RETURN == -1) {
-		}
-
-		if (TEST_RETURN == -1) {
 			if (TEST_ERRNO & (EBUSY | ENOTEMPTY)) {
 				/* For functionality tests, verify that the
 				 * directory wasn't removed.
-- 
1.6.0.2


------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [LTP] [PATCH]  [PATCH] rmdir/rmdir05: Delete unnecessary if
  2015-09-10  1:02 [LTP] [PATCH] [PATCH] rmdir/rmdir05: Delete unnecessary if Cui Bixuan
@ 2015-09-10  1:04 ` Cui Bixuan
  2015-09-30 11:09   ` Cyril Hrubis
  2015-09-10  6:00 ` Zeng Linggang
  1 sibling, 1 reply; 4+ messages in thread
From: Cui Bixuan @ 2015-09-10  1:04 UTC (permalink / raw)
  To: ltp

Delete unnecessary if in testcase

Signed-off-by: Cui Bixuan <cuibixuan@huawei.com>
---
 testcases/kernel/syscalls/rmdir/rmdir05.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/testcases/kernel/syscalls/rmdir/rmdir05.c b/testcases/kernel/syscalls/rmdir/rmdir05.c
index 10037c7..2f0f102 100644
--- a/testcases/kernel/syscalls/rmdir/rmdir05.c
+++ b/testcases/kernel/syscalls/rmdir/rmdir05.c
@@ -81,9 +81,6 @@ int main(int argc, char **argv)
 		TEST(rmdir("."));

 		if (TEST_RETURN == -1) {
-		}
-
-		if (TEST_RETURN == -1) {
 			if (TEST_ERRNO & (EBUSY | ENOTEMPTY)) {
 				/* For functionality tests, verify that the
 				 * directory wasn't removed.
-- 
1.6.0.2


.




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH]  [PATCH] rmdir/rmdir05: Delete unnecessary if
  2015-09-10  1:02 [LTP] [PATCH] [PATCH] rmdir/rmdir05: Delete unnecessary if Cui Bixuan
  2015-09-10  1:04 ` Cui Bixuan
@ 2015-09-10  6:00 ` Zeng Linggang
  1 sibling, 0 replies; 4+ messages in thread
From: Zeng Linggang @ 2015-09-10  6:00 UTC (permalink / raw)
  To: Cui Bixuan; +Cc: zhuyanpeng, ltp-list, ltp, zhanyongming

Hello,

CC: ltp@lists.linux.it

On Thu, 2015-09-10 at 01:02 +0000, Cui Bixuan wrote:
> Delete unnecessary if in testcase
> 
> Signed-off-by: Cui Bixuan <cuibixuan@huawei.com>
> ---
>  testcases/kernel/syscalls/rmdir/rmdir05.c |    3 ---
>  1 files changed, 0 insertions(+), 3 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/rmdir/rmdir05.c b/testcases/kernel/syscalls/rmdir/rmdir05.c
> index 10037c7..2f0f102 100644
> --- a/testcases/kernel/syscalls/rmdir/rmdir05.c
> +++ b/testcases/kernel/syscalls/rmdir/rmdir05.c
> @@ -81,9 +81,6 @@ int main(int argc, char **argv)
>  		TEST(rmdir("."));
>  
>  		if (TEST_RETURN == -1) {
> -		}
> -
> -		if (TEST_RETURN == -1) {
>  			if (TEST_ERRNO & (EBUSY | ENOTEMPTY)) {
>  				/* For functionality tests, verify that the
>  				 * directory wasn't removed.

Good catch.
And more cleanup:
----------------------------------------------------------------------------------------
diff --git a/testcases/kernel/syscalls/bind/bind01.c b/testcases/kernel/syscalls/bind/bind01.c
index 6a3bc50..54c54c7 100644
--- a/testcases/kernel/syscalls/bind/bind01.c
+++ b/testcases/kernel/syscalls/bind/bind01.c
@@ -119,10 +119,8 @@ int main(int argc, char *argv[])
 
 			TEST(bind
 			     (s, tdat[testno].sockaddr, tdat[testno].salen));
-			if (TEST_RETURN > 0) {
+			if (TEST_RETURN > 0)
 				TEST_RETURN = 0;
-			} else {
-			}
 			if (TEST_RETURN != tdat[testno].retval ||
 			    (TEST_RETURN < 0 &&
 			     TEST_ERRNO != tdat[testno].experrno)) {
diff --git a/testcases/kernel/syscalls/mkdir/mkdir01.c b/testcases/kernel/syscalls/mkdir/mkdir01.c
index 9839a09..9488dbe 100644
--- a/testcases/kernel/syscalls/mkdir/mkdir01.c
+++ b/testcases/kernel/syscalls/mkdir/mkdir01.c
@@ -141,8 +141,6 @@ int main(int ac, char **av)
 		TEST(mkdir(bad_addr, 0777));
 
 		/* check return code */
-		if (TEST_RETURN == -1) {
-		}
 
 		if (TEST_RETURN == -1) {
 			if (TEST_ERRNO == EFAULT) {
@@ -171,8 +169,6 @@ int main(int ac, char **av)
 		TEST(mkdir(get_high_address(), 0777));
 
 		/* check return code */
-		if (TEST_RETURN == -1) {
-		}
 
 		if (TEST_RETURN == -1) {
 			if (TEST_ERRNO == EFAULT) {
diff --git a/testcases/kernel/syscalls/rmdir/rmdir03.c b/testcases/kernel/syscalls/rmdir/rmdir03.c
index 8a42058..acdb4e7 100644
--- a/testcases/kernel/syscalls/rmdir/rmdir03.c
+++ b/testcases/kernel/syscalls/rmdir/rmdir03.c
@@ -246,9 +246,6 @@ void dochild1(void)
 	/* rmdir tstdir2 */
 	TEST(rmdir(tstdir2));
 
-	if (TEST_ERRNO) {
-	}
-
 	if (TEST_RETURN != -1) {
 		retval = 1;
 		tst_resm(TFAIL, "call succeeded unexpectedly");
@@ -284,9 +281,6 @@ void dochild2(void)
 	/* rmdir tstdir4 */
 	TEST(rmdir(tstdir4));
 
-	if (TEST_ERRNO) {
-	}
-
 	if (TEST_RETURN != -1) {
 		retval = 1;
 		tst_resm(TFAIL, "call succeeded unexpectedly");
diff --git a/testcases/kernel/syscalls/rmdir/rmdir05.c b/testcases/kernel/syscalls/rmdir/rmdir05.c
index 10037c7..cdfca1b 100644
--- a/testcases/kernel/syscalls/rmdir/rmdir05.c
+++ b/testcases/kernel/syscalls/rmdir/rmdir05.c
@@ -81,9 +81,6 @@ int main(int argc, char **argv)
 		TEST(rmdir("."));
 
 		if (TEST_RETURN == -1) {
-		}
-
-		if (TEST_RETURN == -1) {
 			if (TEST_ERRNO & (EBUSY | ENOTEMPTY)) {
 				/* For functionality tests, verify that the
 				 * directory wasn't removed.
@@ -125,9 +122,6 @@ int main(int argc, char **argv)
 		TEST(rmdir(bad_addr));
 
 		if (TEST_RETURN == -1) {
-		}
-
-		if (TEST_RETURN == -1) {
 			if (TEST_ERRNO == EFAULT) {
 				tst_resm(TPASS,
 					 "rmdir() - path argument points below the minimum allocated address space failed as expected with errno %d : %s",
@@ -151,8 +145,6 @@ int main(int argc, char **argv)
 
 		TEST(rmdir(get_high_address()));
 
-		if (TEST_RETURN == -1) {
-		}
 
 		if (TEST_RETURN == -1) {
 			if (TEST_ERRNO == EFAULT) {
diff --git a/testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler02.c b/testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler02.c
index ba0e894..764cb7f 100644
--- a/testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler02.c
+++ b/testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler02.c
@@ -94,9 +94,6 @@ int main(int ac, char **av)
 
 			TEST(sched_setscheduler(pid, SCHED_FIFO, &param));
 
-			if (TEST_ERRNO) {
-			}
-
 			if (TEST_RETURN != -1) {
 				tst_resm(TFAIL, "sched_setscheduler(2) passed "
 					 "with non root priveledges");
diff --git a/testcases/kernel/syscalls/setregid/setregid03.c b/testcases/kernel/syscalls/setregid/setregid03.c
index 2a13c72..ea2c0a5 100644
--- a/testcases/kernel/syscalls/setregid/setregid03.c
+++ b/testcases/kernel/syscalls/setregid/setregid03.c
@@ -154,8 +154,6 @@ int main(int ac, char **av)
 						 *test_data[i].eff_gid);
 					flag = -1;
 				}
-				if (test_ret == -1) {
-				}
 
 				gid_verify(test_data[i].exp_real_usr,
 					   test_data[i].exp_eff_usr,
diff --git a/testcases/kernel/syscalls/setreuid/setreuid03.c b/testcases/kernel/syscalls/setreuid/setreuid03.c
index b62098e..2f5bf03 100644
--- a/testcases/kernel/syscalls/setreuid/setreuid03.c
+++ b/testcases/kernel/syscalls/setreuid/setreuid03.c
@@ -136,8 +136,6 @@ int main(int ac, char **av)
 					 *test_data[i].eff_uid);
 			}
 
-			if (TEST_RETURN == -1) {
-			}
 			uid_verify(test_data[i].exp_real_usr,
 				   test_data[i].exp_eff_usr,
 				   test_data[i].test_msg);
diff --git a/testcases/kernel/syscalls/setreuid/setreuid05.c b/testcases/kernel/syscalls/setreuid/setreuid05.c
index 39b30f9..073d0ad 100644
--- a/testcases/kernel/syscalls/setreuid/setreuid05.c
+++ b/testcases/kernel/syscalls/setreuid/setreuid05.c
@@ -137,8 +137,6 @@ int main(int argc, char **argv)
 						 *test_data[i].eff_uid);
 				}
 
-				if (TEST_RETURN == -1) {
-				}
 				uid_verify(test_data[i].exp_real_usr,
 					   test_data[i].exp_eff_usr,
 					   test_data[i].test_msg);
diff --git a/testcases/kernel/syscalls/setsockopt/setsockopt01.c b/testcases/kernel/syscalls/setsockopt/setsockopt01.c
index f25694a..f7b9e57 100644
--- a/testcases/kernel/syscalls/setsockopt/setsockopt01.c
+++ b/testcases/kernel/syscalls/setsockopt/setsockopt01.c
@@ -145,9 +145,6 @@ int main(int argc, char *argv[])
 					tdat[testno].optval,
 					tdat[testno].optlen));
 
-			if (TEST_RETURN == -1) {
-			}
-
 			if (TEST_RETURN != tdat[testno].retval ||
 			    (TEST_RETURN < 0 &&
 			     TEST_ERRNO != tdat[testno].experrno)) {
diff --git a/testcases/kernel/syscalls/socket/socket01.c b/testcases/kernel/syscalls/socket/socket01.c
index f471d8b..eaa7796 100644
--- a/testcases/kernel/syscalls/socket/socket01.c
+++ b/testcases/kernel/syscalls/socket/socket01.c
@@ -94,10 +94,8 @@ int main(int argc, char *argv[])
 		for (testno = 0; testno < TST_TOTAL; ++testno) {
 			TEST((s = socket(tdat[testno].domain, tdat[testno].type,
 					 tdat[testno].proto)));
-			if (TEST_RETURN >= 0) {
+			if (TEST_RETURN >= 0)
 				TEST_RETURN = 0;	/* > 0 equivalent */
-			} else {
-			}
 			if (TEST_RETURN != tdat[testno].retval || (TEST_RETURN < 0 && (TEST_ERRNO != tdat[testno].experrno && TEST_ERRNO != EPROTONOSUPPORT))) {	/* Change for defect 21065 for kernel change */
 				tst_resm(TFAIL, "%s ; returned"	/* of return code for this test but don't want */
 					 " %d (expected %d), errno %d (expected"	/* to break on older kernels */
diff --git a/testcases/kernel/syscalls/socketpair/socketpair01.c b/testcases/kernel/syscalls/socketpair/socketpair01.c
index 3a045b7..ca07a5e 100644
--- a/testcases/kernel/syscalls/socketpair/socketpair01.c
+++ b/testcases/kernel/syscalls/socketpair/socketpair01.c
@@ -106,10 +106,8 @@ int main(int argc, char *argv[])
 					     tdat[testno].type,
 					     tdat[testno].proto,
 					     tdat[testno].sv)));
-			if (TEST_RETURN >= 0) {
+			if (TEST_RETURN >= 0)
 				TEST_RETURN = 0;	/* > 0 equivalent */
-			} else {
-			}
 			if (TEST_RETURN != tdat[testno].retval ||
 			    (TEST_RETURN &&
 			     (TEST_ERRNO != tdat[testno].experrno
----------------------------------------------------------------------------------------

Thanks,
Zeng


------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [LTP] [PATCH]  [PATCH] rmdir/rmdir05: Delete unnecessary if
  2015-09-10  1:04 ` Cui Bixuan
@ 2015-09-30 11:09   ` Cyril Hrubis
  0 siblings, 0 replies; 4+ messages in thread
From: Cyril Hrubis @ 2015-09-30 11:09 UTC (permalink / raw)
  To: ltp

Hi!
> Delete unnecessary if in testcase

Pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-30 11:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-10  1:02 [LTP] [PATCH] [PATCH] rmdir/rmdir05: Delete unnecessary if Cui Bixuan
2015-09-10  1:04 ` Cui Bixuan
2015-09-30 11:09   ` Cyril Hrubis
2015-09-10  6:00 ` Zeng Linggang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.