Skip to content

Commit fa2fd7c

Browse files
lneelyLevi Neely
andauthored
Revert "Testability refactor: extract helpers, add stress/send tests, ppagecache/pfs extraction (#383)" (#384)
This reverts commit 4618e24. Co-authored-by: Levi Neely <lkn@darkstar.example.net>
1 parent 4618e24 commit fa2fd7c

10 files changed

Lines changed: 2 additions & 757 deletions

File tree

Makefile

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,7 @@ TEST_BINS := \
171171
tests/test_pfstasks_tree \
172172
tests/test_pfstasks_db \
173173
tests/test_plocks \
174-
tests/test_pfsupload \
175-
tests/test_ppagecache \
176-
tests/test_pfs_helpers
174+
tests/test_pfsupload
177175

178176
.PHONY: test tests check clean-tests
179177

@@ -240,17 +238,6 @@ tests/test_pfsupload: $(UNIT_DIR)/test_pfsupload.c $(LIBDIR)/pfsupload_send.c $(
240238
$(CC) $(TEST_CFLAGS) $(CFLAGS) -o $@ $^ \
241239
-Wl,--wrap=papi_send # redirect papi_send → __wrap_papi_send; GNU ld only (not macOS Apple ld)
242240

243-
tests/test_ppagecache: $(UNIT_DIR)/test_ppagecache.c $(LIBDIR)/ppagecache_helpers.c $(LIBDIR)/pcrc32c.c $(LIBDIR)/pdbg.c $(LIBDIR)/pmem.c $(LIBDIR)/putil.c $(LIBDIR)/ppath.c tests/stubs/test_stubs.c
244-
$(CC) $(TEST_CFLAGS) $(CFLAGS) -o $@ $^
245-
246-
tests/test_pfs_helpers: $(UNIT_DIR)/test_pfs_helpers.c $(LIBDIR)/pfs_helpers.c $(LIBDIR)/pfstasks_tree.c $(LIBDIR)/ptree.c $(LIBDIR)/pcrc32c.c $(LIBDIR)/pdbg.c $(LIBDIR)/pmem.c $(LIBDIR)/putil.c $(LIBDIR)/ppath.c tests/stubs/test_stubs.c
247-
$(CC) $(TEST_CFLAGS) $(CFLAGS) -o $@ $^ \
248-
-Wl,--wrap=pfs_crpt_plain_size \
249-
-Wl,--wrap=pfs_task_get_folder_tasks_rdlocked \
250-
-Wl,--wrap=ptimer_time
251-
# ^ GNU ld only; --wrap stubs out encrypted-size, folder-task lookup, and timer
252-
253-
254241
tests/test_read_response: $(UNIT_DIR)/test_read_response.cpp rpcclient.cpp tests/stubs/test_stubs_cpp.c
255242
$(CXX) $(TEST_CXXFLAGS) $(CXXFLAGS) -o $@ $^
256243

pclsync/pfs.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
#include "pssl.h"
6464
#include "pstatus.h"
6565
#include "psys.h"
66-
#include "pfs_helpers.h"
6766
#include "ptimer.h"
6867

6968

@@ -3807,9 +3806,6 @@ static int pfs_do_start() {
38073806

38083807
myuid = getuid();
38093808
mygid = getgid();
3810-
/* Keep pfs_helpers.c in sync for helper-based callers */
3811-
pfs_stat_uid = myuid;
3812-
pfs_stat_gid = mygid;
38133809
pthread_mutex_lock(&start_mutex);
38143810
if (started)
38153811
goto err00;

pclsync/pfs_helpers.c

Lines changed: 0 additions & 148 deletions
This file was deleted.

pclsync/pfs_helpers.h

Lines changed: 0 additions & 85 deletions
This file was deleted.

pclsync/pfsfolder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static void check_userid(uint64_t userid, uint64_t folderid,
148148
do_check_userid(userid, folderid, shareid);
149149
}
150150

151-
__attribute__((weak)) psync_fspath_t *pfs_fldr_resolve_path(const char *path) {
151+
psync_fspath_t *pfs_fldr_resolve_path(const char *path) {
152152
psync_fsfolderid_t cfolderid;
153153
const char *sl;
154154
psync_fstask_folder_t *folder;

pclsync/ppagecache.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#include "pmem.h"
4444
#include "pnetlibs.h"
4545
#include "ppagecache.h"
46-
#include "ppagecache_helpers.h"
4746
#include "ppath.h"
4847
#include "prun.h"
4948
#include "psettings.h"

pclsync/ppagecache_helpers.c

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)