[PATCH v2 05/15] test-dir-iterator: print EACCES and ELOOP errno set by dir_iterator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently, only ENOENT and ENOTDIR errno names are explicitly printed
when an unsuccessful call to dir_iterator_begin occurs. In case any
other errno happens it's collapsed and ESOMETHINGELSE is printed.
ESOMETHINGELSE collapses a lot of errno error numbers which makes
explicitly testing for specific cases of directory hierarcies
impossible.

This commit allows for more thorought testing by seperating EACCES and
ELOOP errno from ESOMETHINGELSE, which makes them explicitly printed
instead of just collapsed into ESOMETHINGELSE.

Right now, there isn't any test that depends on ESOMETHINGELSE directly,
neither in EACCES or ELOOP as a result, since only errno error codes set
by unsuccessful dir_iterator_begin calls are printed and the ones set by
dir_iterator_advance are ignored. However, this commit provides the
required support that future tests need to improve test coverage.

Signed-off-by: Plato Kiorpelidis <kioplato@xxxxxxxxx>
---
 t/helper/test-dir-iterator.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/t/helper/test-dir-iterator.c b/t/helper/test-dir-iterator.c
index 81e931673e..cdb9269ad5 100644
--- a/t/helper/test-dir-iterator.c
+++ b/t/helper/test-dir-iterator.c
@@ -9,6 +9,8 @@ static const char *error_name(int error_number)
 	switch (error_number) {
 	case ENOENT: return "ENOENT";
 	case ENOTDIR: return "ENOTDIR";
+	case EACCES: return "EACCES";
+	case ELOOP: return "ELOOP";
 	default: return "ESOMETHINGELSE";
 	}
 }
-- 
2.36.1




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux