Expected errno setted in array "exp_enos" do not match
echo test item rightly, leading to two problems:

* Not every test item in mount02 is executed.
     There are 13 test items in mount02 currently to test error:
     ENODEV, ENOTBLK, EBUSY, EBUSY, EINVAL, EINVAL, EINVAL, EFAULT,
     EFAULT, ENAMETOOLONG, ENOENT, ENOENT, ENOTDIR

     But, only 8 of them are tested as specified in array "exp_enos":
     ENODEV, ENOTBLK, EBUSY, EINVAL, EFAULT, ENAMETOOLONG,
     ENOENT, ENOTDIR

* For test item which is executed, its errno returned is maybe not
the one expected.

This patch modifies array "exp_enos" to make it one-to-one correspondent
with echo test item, to fix above problems.

Signed-off-by: DAN LI <[email protected]>
---
 testcases/kernel/syscalls/mount/mount02.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/syscalls/mount/mount02.c 
b/testcases/kernel/syscalls/mount/mount02.c
index 8dcf8de..95796f2 100644
--- a/testcases/kernel/syscalls/mount/mount02.c
+++ b/testcases/kernel/syscalls/mount/mount02.c
@@ -81,8 +81,10 @@ static char *device;
 static int Tflag;
 static int Dflag;

-static int exp_enos[] = { ENODEV, ENOTBLK, EBUSY, EINVAL, EFAULT, ENAMETOOLONG,
-       ENOENT, ENOTDIR, 0
+static int exp_enos[] = {
+       ENODEV, ENOTBLK, EBUSY, EBUSY, EINVAL,
+       EINVAL, EINVAL, EFAULT, EFAULT, ENAMETOOLONG,
+       ENOENT, ENOENT, ENOTDIR, 0
 };

 int TST_TOTAL = (sizeof(exp_enos) / sizeof(exp_enos[0])) - 1;
-- 
1.8.1

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to