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

Unified Diff: base/containers/stack_container_unittest.cc

Issue 2932053002: Use C++11 alignment primitives (Closed)
Patch Set: Fix merge Created 3 years, 6 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 | « base/containers/stack_container.h ('k') | base/lazy_instance.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/containers/stack_container_unittest.cc
diff --git a/base/containers/stack_container_unittest.cc b/base/containers/stack_container_unittest.cc
index 05c733a4a79b4e0f63d9852955877c59dcfbd377..2bb95379ba1f7c9f1c960936ee6ddf477a0e3ddd 100644
--- a/base/containers/stack_container_unittest.cc
+++ b/base/containers/stack_container_unittest.cc
@@ -8,7 +8,6 @@
#include <algorithm>
-#include "base/memory/aligned_memory.h"
#include "base/memory/ref_counted.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -107,9 +106,9 @@ namespace {
template <size_t alignment>
class AlignedData {
public:
- AlignedData() { memset(data_.void_data(), 0, alignment); }
+ AlignedData() { memset(data_, 0, alignment); }
~AlignedData() {}
- base::AlignedMemory<alignment, alignment> data_;
+ alignas(alignment) char data_[alignment];
};
} // anonymous namespace
@@ -120,11 +119,11 @@ class AlignedData {
TEST(StackContainer, BufferAlignment) {
StackVector<wchar_t, 16> text;
text->push_back(L'A');
- EXPECT_ALIGNED(&text[0], ALIGNOF(wchar_t));
+ EXPECT_ALIGNED(&text[0], alignof(wchar_t));
StackVector<double, 1> doubles;
doubles->push_back(0.0);
- EXPECT_ALIGNED(&doubles[0], ALIGNOF(double));
+ EXPECT_ALIGNED(&doubles[0], alignof(double));
StackVector<AlignedData<16>, 1> aligned16;
aligned16->push_back(AlignedData<16>());
« no previous file with comments | « base/containers/stack_container.h ('k') | base/lazy_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698