Skip to content

Commit

Permalink
When we enabled global file-caching in f77cbf9, we did not update the…
Browse files Browse the repository at this point in the history
… tests
  • Loading branch information
mywave82 committed Feb 4, 2024
1 parent d5286ac commit 321a991
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 11 deletions.
34 changes: 25 additions & 9 deletions filesel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,17 @@ filesystem-bzip2-test$(EXE_SUFFIX): filesystem-bzip2-test.c \
adbmeta.h \
dirdb.h \
filesystem-bzip2.h \
filesystem-file-mem.o \
filesystem-dir-mem.o
$(CC) $< -o $@ filesystem-file-mem.o filesystem-dir-mem.o -lbz2
filesystem-file-mem-nocache.o \
filesystem-dir-mem-nocache.o
$(CC) $< -o $@ filesystem-file-mem-nocache.o filesystem-dir-mem-nocache.o -lbz2

filesystem-dir-mem-nocache.o: filesystem-dir-mem.c \
../config.h \
../types.h \
dirdb.h \
filesystem.h \
filesystem-dir-mem.h
$(CC) $< -o $@ -c -DFILEHANDLE_CACHE_DISABLE

filesystem-dir-mem.o: filesystem-dir-mem.c \
../config.h \
Expand Down Expand Up @@ -173,6 +181,14 @@ filesystem-file-dev.o: filesystem-file-dev.c \
../filesel/pfilesel.h
$(CC) $< -o $@ -c

filesystem-file-mem-nocache.o: filesystem-file-mem.c \
../config.h \
../types.h \
dirdb.h \
filesystem.h \
filesystem-file-mem.h
$(CC) $< -o $@ -c -DFILEHANDLE_CACHE_DISABLE

filesystem-file-mem.o: filesystem-file-mem.c \
../config.h \
../types.h \
Expand Down Expand Up @@ -200,9 +216,9 @@ filesystem-gzip-test$(EXE_SUFFIX): filesystem-gzip-test.c \
filesystem-file-mem.h \
filesystem-dir-mem.h \
filesystem-gzip.h \
filesystem-dir-mem.o \
filesystem-file-mem.o
$(CC) $< -o $@ filesystem-file-mem.o filesystem-dir-mem.o -lz
filesystem-dir-mem-nocache.o \
filesystem-file-mem-nocache.o
$(CC) $< -o $@ filesystem-file-mem-nocache.o filesystem-dir-mem-nocache.o -lz

filesystem-filehandle-cache.o: filesystem-filehandle-cache.c \
../config.h \
Expand Down Expand Up @@ -308,9 +324,9 @@ filesystem-tar-test$(EXE_SUFFIX): filesystem-tar-test.c \
filesystem-tar.h \
filesystem-dir-mem.h \
filesystem-file-mem.h \
filesystem-dir-mem.o \
filesystem-file-mem.o
$(CC) $< filesystem-dir-mem.o filesystem-file-mem.o -o $@
filesystem-dir-mem-nocache.o \
filesystem-file-mem-nocache.o
$(CC) $< filesystem-dir-mem-nocache.o filesystem-file-mem-nocache.o -o $@

filesystem-unix.o: filesystem-unix.c \
../config.h \
Expand Down
1 change: 1 addition & 0 deletions filesel/filesystem-bzip2-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#define INPUTBUFFERSIZE 128
#define OUTPUTBUFFERSIZE 64
#define FILEHANDLE_CACHE_DISABLE

#include "filesystem-bzip2.c"
#include "filesystem-dir-mem.h"
Expand Down
1 change: 1 addition & 0 deletions filesel/filesystem-gzip-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#define INPUTBUFFERSIZE 128
#define OUTPUTBUFFERSIZE 64
#define FILEHANDLE_CACHE_DISABLE

#include "filesystem-gzip.c"
#include "filesystem-dir-mem.h"
Expand Down
5 changes: 3 additions & 2 deletions filesel/filesystem-tar-test.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* unit test for filesystem-tar.c */

#define FILEHANDLE_CACHE_DISABLE

#include "filesystem-tar.c"
#include <unistd.h>
#include "filesystem-dir-mem.h"
Expand Down Expand Up @@ -2042,7 +2044,7 @@ void dirdbUnref (uint32_t ref, enum dirdb_use use)
dirdbPrint();
} else {
dirdb_failures++;
printf (ANSI_COLOR_RED "dirdbRef (%d) called on an invalid node" ANSI_COLOR_RESET "\n", ref);
printf (ANSI_COLOR_RED "dirdbUnref (%d) called on an invalid node" ANSI_COLOR_RESET "\n", ref);
}

}
Expand All @@ -2064,7 +2066,6 @@ void dirdbGetName_internalstr (uint32_t ref, const char **retval)
dirdb_failures++;
printf (ANSI_COLOR_RED "dirdbGetName_internalstr (%d) called on an invalid node" ANSI_COLOR_RESET "\n", ref);
}
dirdbPrint();
}

void dirdbGetName_malloc (uint32_t ref, char **retval)
Expand Down

0 comments on commit 321a991

Please sign in to comment.