Skip to content

Commit

Permalink
fix bad json error
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Nov 30, 2023
1 parent c953421 commit abb0253
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/nanoarrow/nanoarrow_testing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,8 @@ class TestingJSONReader {
ArrowArrayStreamMove(stream.get(), out);
return NANOARROW_OK;
} catch (json::exception& e) {
ArrowErrorSet(error, "Exception in TestingJSONReader::ReadBatch(): %s", e.what());
ArrowErrorSet(error, "Exception in TestingJSONReader::ReadDataFile(): %s",
e.what());
return EINVAL;
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/nanoarrow/nanoarrow_testing_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,9 @@ TEST(NanoarrowTestingTest, NanoarrowTestingTestRoundtripDataFile) {
std::stringstream data_file_json_roundtrip;
ASSERT_EQ(writer.WriteDataFile(data_file_json_roundtrip, stream.get()), NANOARROW_OK);
EXPECT_EQ(data_file_json_roundtrip.str(), data_file_json);

// Also test error for invalid JSON
ASSERT_EQ(reader.ReadDataFile("{", stream.get()), EINVAL);
}

TEST(NanoarrowTestingTest, NanoarrowTestingTestReadBatch) {
Expand Down

0 comments on commit abb0253

Please sign in to comment.