From ef01498cb0570438155bf1f7d049b9ac36dbd910 Mon Sep 17 00:00:00 2001 From: "Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com)" Date: Sun, 21 Jun 2020 20:53:20 +0100 Subject: Fix clone_extents() not working on Mac OS. --- test/tests/clone_extents.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/tests/clone_extents.cpp') diff --git a/test/tests/clone_extents.cpp b/test/tests/clone_extents.cpp index eda574bd..652e719e 100644 --- a/test/tests/clone_extents.cpp +++ b/test/tests/clone_extents.cpp @@ -124,8 +124,8 @@ static inline void TestCloneExtents() { if(shouldbe.data()[n] != handles[1].fh.address()[n]) { - std::cerr << "Byte at offset " << n << " is '" << (int) *(char *) &shouldbe.data()[n] << "' in source and is '" << (int) *(char *) &handles[1].fh.address()[n] - << "' in destination." << std::endl; + std::cerr << "Byte at offset " << n << " is '" << (int) *(char *) &shouldbe.data()[n] << "' in source and is '" + << (int) *(char *) &handles[1].fh.address()[n] << "' in destination." << std::endl; BOOST_REQUIRE(shouldbe.data()[n] == handles[1].fh.address()[n]); break; } @@ -196,7 +196,7 @@ static inline void TestCloneOrCopyFileWhole() dest_stat.fill(destfh).value(); std::cout << "Source file has " << src_stat.st_blocks << " blocks allocated. Destination file has " << dest_stat.st_blocks << " blocks allocated." << std::endl; - BOOST_CHECK(src_stat.st_blocks <= dest_stat.st_blocks); + BOOST_CHECK(abs((long) src_stat.st_blocks - (long) dest_stat.st_blocks) < ((long) src_stat.st_blocks / 8)); for(size_t n = 0; n < maximum_extent; n++) { -- cgit v1.2.3