Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AVRO-4085][C++] Fix file size extraction error on windows platform #3229

Merged
merged 1 commit into from
Oct 29, 2024
Merged
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
8 changes: 3 additions & 5 deletions lang/c++/test/DataFileTests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,7 @@ class DataFileTest {
void testReaderSplits() {
boost::mt19937 random(static_cast<uint32_t>(time(nullptr)));
avro::DataFileReader<ComplexInteger> df(filename, writerSchema);
std::ifstream just_for_length(
filename, std::ifstream::ate | std::ifstream::binary);
int length = static_cast<int>(just_for_length.tellg());
int length = static_cast<int>(boost::filesystem::file_size(filename));
int splits = 10;
int end = length; // end of split
int remaining = end; // bytes remaining
Expand Down Expand Up @@ -696,7 +694,7 @@ struct codec_traits<ReaderObj> {
if (auto *rd =
dynamic_cast<avro::ResolvingDecoder *>(&d)) {
const std::vector<size_t> fo = rd->fieldOrder();
for (unsigned long it : fo) {
for (const auto it : fo) {
switch (it) {
case 0: {
avro::decode(d, v.s2);
Expand Down Expand Up @@ -1097,7 +1095,7 @@ init_unit_test_suite(int, char *[]) {
shared_ptr<DataFileTest> t9(new DataFileTest("test9.df", sch, sch));
ts->add(BOOST_CLASS_TEST_CASE(&DataFileTest::testWrite, t9));
ts->add(BOOST_CLASS_TEST_CASE(&DataFileTest::testReaderSyncSeek, t9));
//ts->add(BOOST_CLASS_TEST_CASE(&DataFileTest::testCleanup, t9));
ts->add(BOOST_CLASS_TEST_CASE(&DataFileTest::testCleanup, t9));
boost::unit_test::framework::master_test_suite().add(ts);
}
{
Expand Down