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

Unified Diff: third_party/WebKit/Source/wtf/VectorTest.cpp

Issue 2110183005: WTF::Vector: Fix primitive types identified as not safe to memcpy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded garbage; add a test for pointers. Created 4 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 | « third_party/WebKit/Source/wtf/TypeTraits.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/VectorTest.cpp
diff --git a/third_party/WebKit/Source/wtf/VectorTest.cpp b/third_party/WebKit/Source/wtf/VectorTest.cpp
index f0d164d3aac1608a63f989e6e4eda09842288021..74b08ca5bdc19e93e4113672f360496a65966b2a 100644
--- a/third_party/WebKit/Source/wtf/VectorTest.cpp
+++ b/third_party/WebKit/Source/wtf/VectorTest.cpp
@@ -688,6 +688,14 @@ TEST(VectorTest, InitializerList)
EXPECT_EQ(3, vector3[2]);
}
+static_assert(VectorTraits<int>::canCopyWithMemcpy, "int should be copied with memcopy.");
+static_assert(VectorTraits<char>::canCopyWithMemcpy, "char should be copied with memcpy.");
+static_assert(VectorTraits<LChar>::canCopyWithMemcpy, "LChar should be copied with memcpy.");
+static_assert(VectorTraits<UChar>::canCopyWithMemcpy, "UChar should be copied with memcpy.");
+
+class UnknownType;
+static_assert(VectorTraits<UnknownType*>::canCopyWithMemcpy, "Pointers should be copied with memcpy.");
+
} // anonymous namespace
} // namespace WTF
« no previous file with comments | « third_party/WebKit/Source/wtf/TypeTraits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698