Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cpp/src/arrow/allocator-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// under the License.

#include "gtest/gtest.h"

#include "arrow/allocator.h"
#include "arrow/test-util.h"

Expand Down
1 change: 1 addition & 0 deletions cpp/src/arrow/allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <cstddef>
#include <memory>
#include <utility>

#include "arrow/memory_pool.h"
#include "arrow/status.h"

Expand Down
18 changes: 18 additions & 0 deletions cpp/src/arrow/io/test-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,24 @@
namespace arrow {
namespace io {

static inline Status ZeroMemoryMap(MemoryMappedFile* file) {
constexpr int64_t kBufferSize = 512;
static constexpr uint8_t kZeroBytes[kBufferSize] = {0};

RETURN_NOT_OK(file->Seek(0));
int64_t position = 0;
int64_t file_size;
RETURN_NOT_OK(file->GetSize(&file_size));

int64_t chunksize;
while (position < file_size) {
chunksize = std::min(kBufferSize, file_size - position);
RETURN_NOT_OK(file->Write(kZeroBytes, chunksize));
position += chunksize;
}
return Status::OK();
}

class MemoryMapFixture {
public:
void TearDown() {
Expand Down
15 changes: 2 additions & 13 deletions cpp/src/arrow/ipc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ set(ARROW_IPC_TEST_LINK_LIBS
arrow_io_static)

set(ARROW_IPC_SRCS
adapter.cc
feather.cc
json.cc
json-internal.cc
metadata.cc
metadata-internal.cc
reader.cc
writer.cc
)
Expand Down Expand Up @@ -64,16 +62,8 @@ ADD_ARROW_TEST(feather-test)
ARROW_TEST_LINK_LIBRARIES(feather-test
${ARROW_IPC_TEST_LINK_LIBS})

ADD_ARROW_TEST(ipc-adapter-test)
ARROW_TEST_LINK_LIBRARIES(ipc-adapter-test
${ARROW_IPC_TEST_LINK_LIBS})

ADD_ARROW_TEST(ipc-file-test)
ARROW_TEST_LINK_LIBRARIES(ipc-file-test
${ARROW_IPC_TEST_LINK_LIBS})

ADD_ARROW_TEST(ipc-metadata-test)
ARROW_TEST_LINK_LIBRARIES(ipc-metadata-test
ADD_ARROW_TEST(ipc-read-write-test)
ARROW_TEST_LINK_LIBRARIES(ipc-read-write-test
${ARROW_IPC_TEST_LINK_LIBS})

ADD_ARROW_TEST(ipc-json-test)
Expand Down Expand Up @@ -148,7 +138,6 @@ add_dependencies(arrow_ipc_objlib metadata_fbs)

# Headers: top level
install(FILES
adapter.h
api.h
feather.h
json.h
Expand Down
Loading