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

Unified Diff: tools/gn/escape_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/escape.cc ('k') | tools/gn/exec_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/escape_unittest.cc
diff --git a/tools/gn/escape_unittest.cc b/tools/gn/escape_unittest.cc
index fd4934861e4b84997bb0390de4cd70e02a3c8abe..f2b2eae19742e1451b17a5126d8710cf85275f1c 100644
--- a/tools/gn/escape_unittest.cc
+++ b/tools/gn/escape_unittest.cc
@@ -8,7 +8,7 @@
TEST(Escape, Ninja) {
EscapeOptions opts;
opts.mode = ESCAPE_NINJA;
- std::string result = EscapeString("asdf: \"$\\bar", opts, NULL);
+ std::string result = EscapeString("asdf: \"$\\bar", opts, nullptr);
EXPECT_EQ("asdf$:$ \"$$\\bar", result);
}
@@ -18,7 +18,7 @@ TEST(Escape, WindowsCommand) {
opts.platform = ESCAPE_PLATFORM_WIN;
// Regular string is passed, even if it has backslashes.
- EXPECT_EQ("foo\\bar", EscapeString("foo\\bar", opts, NULL));
+ EXPECT_EQ("foo\\bar", EscapeString("foo\\bar", opts, nullptr));
// Spaces means the string is quoted, normal backslahes untouched.
bool needs_quoting = false;
@@ -33,10 +33,10 @@ TEST(Escape, WindowsCommand) {
opts.inhibit_quoting = false;
// Backslashes at the end of the string get escaped.
- EXPECT_EQ("\"foo$ bar\\\\\\\\\"", EscapeString("foo bar\\\\", opts, NULL));
+ EXPECT_EQ("\"foo$ bar\\\\\\\\\"", EscapeString("foo bar\\\\", opts, nullptr));
// Backslashes preceeding quotes are escaped, and the quote is escaped.
- EXPECT_EQ("\"foo\\\\\\\"$ bar\"", EscapeString("foo\\\" bar", opts, NULL));
+ EXPECT_EQ("\"foo\\\\\\\"$ bar\"", EscapeString("foo\\\" bar", opts, nullptr));
}
TEST(Escape, PosixCommand) {
@@ -45,10 +45,10 @@ TEST(Escape, PosixCommand) {
opts.platform = ESCAPE_PLATFORM_POSIX;
// : and $ ninja escaped with $. Then Shell-escape backslashes and quotes.
- EXPECT_EQ("a$:\\$ \\\"\\$$\\\\b", EscapeString("a: \"$\\b", opts, NULL));
+ EXPECT_EQ("a$:\\$ \\\"\\$$\\\\b", EscapeString("a: \"$\\b", opts, nullptr));
// Some more generic shell chars.
- EXPECT_EQ("a_\\;\\<\\*b", EscapeString("a_;<*b", opts, NULL));
+ EXPECT_EQ("a_\\;\\<\\*b", EscapeString("a_;<*b", opts, nullptr));
}
TEST(Escape, NinjaPreformatted) {
@@ -56,5 +56,5 @@ TEST(Escape, NinjaPreformatted) {
opts.mode = ESCAPE_NINJA_PREFORMATTED_COMMAND;
// Only $ is escaped.
- EXPECT_EQ("a: \"$$\\b<;", EscapeString("a: \"$\\b<;", opts, NULL));
+ EXPECT_EQ("a: \"$$\\b<;", EscapeString("a: \"$\\b<;", opts, nullptr));
}
« no previous file with comments | « tools/gn/escape.cc ('k') | tools/gn/exec_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698