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

extra byte for files on Windows #199

Merged
merged 1 commit into from
Jan 15, 2020
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
12 changes: 12 additions & 0 deletions test/test_filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,13 @@ TEST_F(TestFilesystemFixture, calculate_directory_size) {
char * path =
rcutils_join_path(this->test_path, "dummy_folder", g_allocator);
size_t size = rcutils_calculate_directory_size(path, g_allocator);
#ifdef WIN32
// Due to different line breaks on windows, we have one more byte in the file.
// See https://github.com/ros2/rcutils/issues/198
ASSERT_EQ(6u, size);
#else
ASSERT_EQ(5u, size);
#endif
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
g_allocator.deallocate(path, g_allocator.state);
});
Expand All @@ -305,7 +311,13 @@ TEST_F(TestFilesystemFixture, calculate_file_size) {
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
g_allocator.deallocate(path, g_allocator.state);
});
#ifdef WIN32
// Due to different line breaks on windows, we have one more byte in the file.
// See https://github.com/ros2/rcutils/issues/198
ASSERT_EQ(6u, size);
#else
ASSERT_EQ(5u, size);
#endif

char * non_existing_path =
rcutils_join_path(this->test_path, "non_existing_file.txt", g_allocator);
Expand Down