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

Unified Diff: base/json/json_reader_unittest.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 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/json/json_reader.cc ('k') | base/json/json_string_value_serializer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_reader_unittest.cc
diff --git a/base/json/json_reader_unittest.cc b/base/json/json_reader_unittest.cc
index 21eec4a07d987a0cda60c3a96c52295c0c1c49f2..1a623561b73afdff5e4d4a24c05497b765fea293 100644
--- a/base/json/json_reader_unittest.cc
+++ b/base/json/json_reader_unittest.cc
@@ -6,11 +6,12 @@
#include <stddef.h>
+#include <memory>
+
#include "base/base_paths.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/path_service.h"
#include "base/strings/string_piece.h"
#include "base/strings/utf_string_conversions.h"
@@ -22,7 +23,7 @@ namespace base {
TEST(JSONReaderTest, Reading) {
// some whitespace checking
- scoped_ptr<Value> root = JSONReader().ReadToValue(" null ");
+ std::unique_ptr<Value> root = JSONReader().ReadToValue(" null ");
ASSERT_TRUE(root.get());
EXPECT_TRUE(root->IsType(Value::TYPE_NULL));
@@ -251,7 +252,7 @@ TEST(JSONReaderTest, Reading) {
EXPECT_EQ(3U, list->GetSize());
// Test with trailing comma. Should be parsed the same as above.
- scoped_ptr<Value> root2 =
+ std::unique_ptr<Value> root2 =
JSONReader::Read("[true, false, null, ]", JSON_ALLOW_TRAILING_COMMAS);
EXPECT_TRUE(root->Equals(root2.get()));
@@ -553,7 +554,7 @@ TEST(JSONReaderTest, ReadFromFile) {
path.Append(FILE_PATH_LITERAL("bom_feff.json")), &input));
JSONReader reader;
- scoped_ptr<Value> root(reader.ReadToValue(input));
+ std::unique_ptr<Value> root(reader.ReadToValue(input));
ASSERT_TRUE(root.get()) << reader.GetErrorMessage();
EXPECT_TRUE(root->IsType(Value::TYPE_DICTIONARY));
}
@@ -561,15 +562,15 @@ TEST(JSONReaderTest, ReadFromFile) {
// Tests that the root of a JSON object can be deleted safely while its
// children outlive it.
TEST(JSONReaderTest, StringOptimizations) {
- scoped_ptr<Value> dict_literal_0;
- scoped_ptr<Value> dict_literal_1;
- scoped_ptr<Value> dict_string_0;
- scoped_ptr<Value> dict_string_1;
- scoped_ptr<Value> list_value_0;
- scoped_ptr<Value> list_value_1;
+ std::unique_ptr<Value> dict_literal_0;
+ std::unique_ptr<Value> dict_literal_1;
+ std::unique_ptr<Value> dict_string_0;
+ std::unique_ptr<Value> dict_string_1;
+ std::unique_ptr<Value> list_value_0;
+ std::unique_ptr<Value> list_value_1;
{
- scoped_ptr<Value> root = JSONReader::Read(
+ std::unique_ptr<Value> root = JSONReader::Read(
"{"
" \"test\": {"
" \"foo\": true,"
« no previous file with comments | « base/json/json_reader.cc ('k') | base/json/json_string_value_serializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698