mirror of
https://github.com/troglobit/libite.git
synced 2026-10-26 12:04:38 +00:00
Add unit test for tree
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
d8cb477861
commit
2d6e8850a2
4 files changed
+23
-24
No files matched your search
@@ -0,0 +1,19 @@
|
||||
#include "check.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int result = 0;
|
||||
size_t i;
|
||||
struct { char *path; int fail; } arr[] = {
|
||||
{ "/etc/passwd", -1 },
|
||||
{ "/dev", 0 },
|
||||
{ "/sbin", 0 },
|
||||
};
|
||||
|
||||
for (i = 0; i < NELEMS(arr); i++) {
|
||||
if (tree(arr[i].path, 1) != arr[i].fail)
|
||||
result++;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
Reference in new issue
Block a user