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

Unified Diff: tools/gn/string_utils_unittest.cc

Issue 798333005: tools/gn: Pass clang-modernize -use-nullptr over it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address Brett's review - revert some clang-format changes Created 6 years 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 | « tools/gn/scope_unittest.cc ('k') | tools/gn/substitution_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/string_utils_unittest.cc
diff --git a/tools/gn/string_utils_unittest.cc b/tools/gn/string_utils_unittest.cc
index 9e69d40286d97a7df6178b5833e266b2f432d579..cb5506596892847277fec36049492e44ffc7e513 100644
--- a/tools/gn/string_utils_unittest.cc
+++ b/tools/gn/string_utils_unittest.cc
@@ -13,10 +13,10 @@
namespace {
bool CheckExpansionCase(const char* input, const char* expected, bool success) {
- Scope scope(static_cast<const Settings*>(NULL));
+ Scope scope(static_cast<const Settings*>(nullptr));
int64 one = 1;
- scope.SetValue("one", Value(NULL, one), NULL);
- scope.SetValue("onestring", Value(NULL, "one"), NULL);
+ scope.SetValue("one", Value(nullptr, one), nullptr);
+ scope.SetValue("onestring", Value(nullptr, "one"), nullptr);
// Construct the string token, which includes the quotes.
std::string literal_string;
@@ -25,7 +25,7 @@ bool CheckExpansionCase(const char* input, const char* expected, bool success) {
literal_string.push_back('"');
Token literal(Location(), Token::STRING, literal_string);
- Value result(NULL, Value::STRING);
+ Value result(nullptr, Value::STRING);
Err err;
bool ret = ExpandStringLiteral(&scope, literal, &result, &err);
@@ -53,12 +53,12 @@ TEST(StringUtils, ExpandStringLiteral) {
EXPECT_TRUE(CheckExpansionCase("$onestring${one}$one", "one11", true));
// Errors
- EXPECT_TRUE(CheckExpansionCase("hello #$", NULL, false));
- EXPECT_TRUE(CheckExpansionCase("hello #$%", NULL, false));
- EXPECT_TRUE(CheckExpansionCase("hello #${", NULL, false));
- EXPECT_TRUE(CheckExpansionCase("hello #${}", NULL, false));
- EXPECT_TRUE(CheckExpansionCase("hello #$nonexistant", NULL, false));
- EXPECT_TRUE(CheckExpansionCase("hello #${unterminated", NULL, false));
+ EXPECT_TRUE(CheckExpansionCase("hello #$", nullptr, false));
+ EXPECT_TRUE(CheckExpansionCase("hello #$%", nullptr, false));
+ EXPECT_TRUE(CheckExpansionCase("hello #${", nullptr, false));
+ EXPECT_TRUE(CheckExpansionCase("hello #${}", nullptr, false));
+ EXPECT_TRUE(CheckExpansionCase("hello #$nonexistant", nullptr, false));
+ EXPECT_TRUE(CheckExpansionCase("hello #${unterminated", nullptr, false));
// Unknown backslash values aren't special.
EXPECT_TRUE(CheckExpansionCase("\\", "\\", true));
« no previous file with comments | « tools/gn/scope_unittest.cc ('k') | tools/gn/substitution_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698