Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1485)

Unified Diff: mojo/public/cpp/bindings/tests/buffer_unittest.cc

Issue 262093011: Revert of Make sure that ScratchBuffer::Allocate() always return 8-byte aligned address. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/cpp/bindings/lib/scratch_buffer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/tests/buffer_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/buffer_unittest.cc b/mojo/public/cpp/bindings/tests/buffer_unittest.cc
index 1487ced7937d6e7e71c9fb181edaf661408677b8..7ef7520f5aec054eea41cdebbb3c9e37e7c222d5 100644
--- a/mojo/public/cpp/bindings/tests/buffer_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/buffer_unittest.cc
@@ -51,23 +51,6 @@
// And a request so large it will overflow and fail.
void* overflow = buf.Allocate(std::numeric_limits<size_t>::max() - 12u);
EXPECT_TRUE(!overflow);
-}
-
-TEST(ScratchBufferTest, Alignment) {
- Environment env;
-
- internal::ScratchBuffer buf;
- // Test that small allocations on the stack are aligned properly.
- void* small = buf.Allocate(1);
- EXPECT_EQ(0, reinterpret_cast<ptrdiff_t>(small) % 8);
- small = buf.Allocate(2);
- EXPECT_EQ(0, reinterpret_cast<ptrdiff_t>(small) % 8);
-
- // Test that large allocations on the heap are aligned properly.
- void* large = buf.Allocate(10*1024);
- EXPECT_EQ(0, reinterpret_cast<ptrdiff_t>(large) % 8);
- large = buf.Allocate(100*1024);
- EXPECT_EQ(0, reinterpret_cast<ptrdiff_t>(large) % 8);
}
// Tests that Buffer::current() returns the correct value.
« no previous file with comments | « mojo/public/cpp/bindings/lib/scratch_buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698