Skip to contentSkip to conversation

rmdir/rmdir05: Delete unnecessary if

PATCH In review Cui Bixuan 3 participants 4 messages Sep 10, 2015 – Sep 30, 2015

lore
Share & tools
lore

Cui Bixuan

author
#0 lore raw

PATCH 1/1 rmdir/rmdir05: Delete unnecessary if

Delete unnecessary if in testcase

---
 testcases/kernel/syscalls/rmdir/rmdir05.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
testcases/kernel/syscalls/rmdir/rmdir05.c +0 -3
index 10037c7..2f0f102 100644
@@ -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.
Signature · 13 lines
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
author
#1 lore raw

PATCH 1/1 rmdir/rmdir05: Delete unnecessary if

Delete unnecessary if in testcase

---
 testcases/kernel/syscalls/rmdir/rmdir05.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
testcases/kernel/syscalls/rmdir/rmdir05.c +0 -3
index 10037c7..2f0f102 100644
@@ -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.
Signature · 4 lines
1.6.0.2


.
#2 lore raw

PATCH 1/1 rmdir/rmdir05: Delete unnecessary if

Hi!

Quoted 1 line

Delete unnecessary if in testcase

Pushed, thanks.

Signature · 2 lines
Cyril Hrubis
[email protected]
#3 lore raw
In reply to Cui Bixuan

Hello,

Quoted 12 lines · Cui Bixuan

Delete unnecessary if in testcase

---
 testcases/kernel/syscalls/rmdir/rmdir05.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
testcases/kernel/syscalls/rmdir/rmdir05.c +0 -0
index 10037c7..2f0f102 100644

testcases/kernel/syscalls/rmdir/rmdir05.c int main(int argc, char **argv) · line 86

Quoted 9 lines
testcases/kernel/syscalls/rmdir/rmdir05.c +0 -3
@@ -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:
----------------------------------------------------------------------------------------

testcases/kernel/syscalls/bind/bind01.c +1 -3
index 6a3bc50..54c54c7 100644
@@ -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)) {
testcases/kernel/syscalls/mkdir/mkdir01.c +0 -4
index 9839a09..9488dbe 100644
@@ -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) {
testcases/kernel/syscalls/rmdir/rmdir03.c +0 -6
index 8a42058..acdb4e7 100644
@@ -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");
testcases/kernel/syscalls/rmdir/rmdir05.c +0 -8
index 10037c7..cdfca1b 100644
@@ -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) {
testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler02.c +0 -3
index ba0e894..764cb7f 100644
@@ -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");
testcases/kernel/syscalls/setregid/setregid03.c +0 -2
index 2a13c72..ea2c0a5 100644
@@ -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,
testcases/kernel/syscalls/setreuid/setreuid03.c +0 -2
index b62098e..2f5bf03 100644
@@ -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);
testcases/kernel/syscalls/setreuid/setreuid05.c +0 -2
index 39b30f9..073d0ad 100644
@@ -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);
testcases/kernel/syscalls/setsockopt/setsockopt01.c +0 -3
index f25694a..f7b9e57 100644
@@ -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)) {
testcases/kernel/syscalls/socket/socket01.c +1 -3
index f471d8b..eaa7796 100644
@@ -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 */
testcases/kernel/syscalls/socketpair/socketpair01.c +1 -3
index 3a045b7..ca07a5e 100644
@@ -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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list