Navigation Menu

Skip to content

Commit

Permalink
droplet: improve testability of existing code
Browse files Browse the repository at this point in the history
  • Loading branch information
arogge committed Aug 18, 2021
1 parent e02d17e commit b948074
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/src/droplet/libdroplet/src/backend/posix/backend.c
Expand Up @@ -717,7 +717,7 @@ static dpl_status_t posix_get(const char* path,
int range_len;

offset = range->start;
range_len = range->start - range->end;
range_len = range->end - range->start;
if (data_len < range_len) {
ret = DPL_EINVAL;
goto end;
Expand Down Expand Up @@ -753,7 +753,7 @@ static dpl_status_t posix_get(const char* path,
goto end;
}

if (data_len != cc) {
if (length != cc) {
ret = DPL_FAILURE;
goto end;
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/stored/backends/chunked_device.cc
Expand Up @@ -522,7 +522,7 @@ bool ChunkedDevice::FlushChunk(bool release_chunk, bool move_to_next_chunk)
retval = EnqueueChunk(&request);
} else {
// no multithreading
Dmsg1(100, "Try to flush chunk number: %d", request.chunk);
Dmsg1(100, "Try to flush chunk number: %d\n", request.chunk);
retval = FlushRemoteChunk(&request);
}

Expand Down
1 change: 1 addition & 0 deletions core/src/stored/backends/droplet_device.cc
Expand Up @@ -644,6 +644,7 @@ bool DropletDevice::ReadRemoteChunk(chunk_io_request* request)
default:
Mmsg2(errmsg, _("Failed to read %s using dpl_fget(): ERR=%s.\n"),
chunk_name.c_str(), dpl_status_str(status));
Dmsg1(100, "%s", errmsg);
dev_errno = DropletErrnoToSystemErrno(status);
Bmicrosleep(INFLIGT_RETRY_TIME, 0);
++tries;
Expand Down
2 changes: 1 addition & 1 deletion core/src/tests/CMakeLists.txt
Expand Up @@ -329,7 +329,7 @@ if(NOT client-only)
endif()

if(NOT client-only)
bareos_add_test(sd_backend LINK_LIBRARIES ${LINK_LIBRARIES} GTest::gmock)
bareos_add_test(sd_backend LINK_LIBRARIES ${LINK_LIBRARIES})
endif()

if(NOT client-only)
Expand Down
@@ -1,4 +1,5 @@
Storage {
Name = test-sd
@UNCOMMENT_SD_BACKEND_DIRECTORY@Backend Directory = @PROJECT_BINARY_DIR@/src/stored/backends
Working Directory = @PROJECT_BINARY_DIR@/
}

0 comments on commit b948074

Please sign in to comment.