Skip to content

Commit

Permalink
test for null file pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Dec 5, 2023
1 parent 7852a34 commit bf15b1d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@ TEST(NanoarrowIpcReader, InputStreamBuffer) {
}

TEST(NanoarrowIpcReader, InputStreamFile) {
struct ArrowIpcInputStream stream;
ASSERT_EQ(ArrowIpcInputStreamInitFile(&stream, nullptr, 1), EINVAL);

uint8_t input_data[] = {0x01, 0x02, 0x03, 0x04, 0x05};
FILE* file_ptr = tmpfile();
ASSERT_NE(file_ptr, nullptr);
ASSERT_EQ(fwrite(input_data, 1, sizeof(input_data), file_ptr), sizeof(input_data));
fseek(file_ptr, 0, SEEK_SET);

struct ArrowIpcInputStream stream;
uint8_t output_data[] = {0xff, 0xff, 0xff, 0xff, 0xff};
int64_t size_read_bytes;

Expand Down

0 comments on commit bf15b1d

Please sign in to comment.