Add autotest for dir

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2015-08-22 22:46:42 +02:00
parent ab2b0f00fa
commit 36da3aa35e
3 changed files with 9 additions and 4 deletions
+1
View File
@@ -67,6 +67,7 @@ include rules.mk
test:
$(MAKE) -f chomp.mk
$(MAKE) -f copyfile.mk
$(MAKE) -f dir.mk
$(MAKE) -f pidfilefn.mk
$(MAKE) -f rsync.mk
+4 -4
View File
@@ -123,7 +123,7 @@ int dir(const char *dir, const char *type, int (*filter) (const char *file), cha
#include <errno.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "otn/c.h"
#include "lite.h"
#define DIR_TYPE_IMAGE ".img"
#define DIR_TYPE_SYSLOG ""
@@ -138,7 +138,7 @@ int simulate_files(int creat)
"rr109.img", "rx100.img", "rx107.img", "rm957.img", "messages"
};
for (i = 0; i < ARRAY_ELEMENTS(files); i++) {
for (i = 0; i < NELEMS(files); i++) {
if (creat)
touch(files[i]);
else
@@ -217,11 +217,11 @@ int main(int argc, char *argv[])
return 0;
}
#endif /* UNITTEST */
#endif /* UNITTEST */
/**
* Local Variables:
* compile-command: "gcc -g -DUNITTEST -o unittest dir.c"
* compile-command: "make V=1 -f dir.mk"
* version-control: t
* indent-tabs-mode: t
* c-file-style: "linux"
+4
View File
@@ -0,0 +1,4 @@
OBJS =
TARGET = dir.test clean
include rules.mk