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

Unified Diff: third_party/WebKit/Source/platform/wtf/PtrUtilTest.cpp

Issue 2787223002: Add more WTF::PtrUtil unit tests (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/wtf/PtrUtilTest.cpp
diff --git a/third_party/WebKit/Source/platform/wtf/PtrUtilTest.cpp b/third_party/WebKit/Source/platform/wtf/PtrUtilTest.cpp
index aabb90986f351927a9aa56e193da5c5a6eded3b7..0914a6714214892575ea87394527ec8d5b0a3598 100644
--- a/third_party/WebKit/Source/platform/wtf/PtrUtilTest.cpp
+++ b/third_party/WebKit/Source/platform/wtf/PtrUtilTest.cpp
@@ -6,9 +6,33 @@
#include "testing/gtest/include/gtest/gtest.h"
+namespace WTF {
+
+TEST(WTF_PtrUtilTest, canWrapUnique) {
+ auto charPtr = new char;
+ auto wrappedCharPtr = wrapUnique(charPtr);
+
+ ASSERT_TRUE(wrappedCharPtr.get());
+}
+
+TEST(WTF_PtrUtilTest, canWrapUniqueArray) {
+ constexpr size_t bufferSize = 20;
+ auto charArray = new char[bufferSize];
+ auto wrappedCharArray = wrapArrayUnique(charArray);
+
+ ASSERT_TRUE(wrappedCharArray.get());
+}
+
+TEST(WTF_PtrUtilTest, canMakeUnique) {
+ auto charPtr = makeUnique<char>();
+
+ ASSERT_TRUE(charPtr.get());
+}
+
TEST(WTF_PtrUtilTest, canMakeUniqueArray) {
constexpr size_t bufferSize = 20;
- auto charArray = WTF::makeUnique<char[]>(bufferSize);
+ auto charArray = makeUnique<char[]>(bufferSize);
ASSERT_TRUE(charArray.get());
}
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698