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

Side by Side Diff: tools/gn/label_unittest.cc

Issue 663673002: Convert the few remaining ARRAYSIZE_UNSAFE -> arraysize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « third_party/cld/base/basictypes.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "tools/gn/err.h" 6 #include "tools/gn/err.h"
7 #include "tools/gn/label.h" 7 #include "tools/gn/label.h"
8 #include "tools/gn/value.h" 8 #include "tools/gn/value.h"
9 9
10 namespace { 10 namespace {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 { "//chrome/", "//chrome:bar(//t:bar(tc))", false, "", " ", "", "" }, 56 { "//chrome/", "//chrome:bar(//t:bar(tc))", false, "", " ", "", "" },
57 { "//chrome/", "//chrome:bar(()", false, "", " ", "", "" }, 57 { "//chrome/", "//chrome:bar(()", false, "", " ", "", "" },
58 { "//chrome/", "(t:b)", false, "", " ", "", "" }, 58 { "//chrome/", "(t:b)", false, "", " ", "", "" },
59 { "//chrome/", ":bar(//t/b)", true, "//chrome/", " bar", "//t/b/", "b" }, 59 { "//chrome/", ":bar(//t/b)", true, "//chrome/", " bar", "//t/b/", "b" },
60 { "//chrome/", ":bar(/t/b)", false, "", " ", "", "" }, 60 { "//chrome/", ":bar(/t/b)", false, "", " ", "", "" },
61 { "//chrome/", ":bar(t/b)", true, "//chrome/", " bar", "//chrome/t/b/", "b" }, 61 { "//chrome/", ":bar(t/b)", true, "//chrome/", " bar", "//chrome/t/b/", "b" },
62 }; 62 };
63 63
64 Label default_toolchain(SourceDir("//t/"), "d"); 64 Label default_toolchain(SourceDir("//t/"), "d");
65 65
66 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); i++) { 66 for (size_t i = 0; i < arraysize(cases); i++) {
67 const ParseDepStringCase& cur = cases[i]; 67 const ParseDepStringCase& cur = cases[i];
68 68
69 std::string location, name; 69 std::string location, name;
70 Err err; 70 Err err;
71 Value v(NULL, Value::STRING); 71 Value v(NULL, Value::STRING);
72 v.string_value() = cur.str; 72 v.string_value() = cur.str;
73 Label result = 73 Label result =
74 Label::Resolve(SourceDir(cur.cur_dir), default_toolchain, v, &err); 74 Label::Resolve(SourceDir(cur.cur_dir), default_toolchain, v, &err);
75 EXPECT_EQ(cur.success, !err.has_error()) << i << " " << cur.str; 75 EXPECT_EQ(cur.success, !err.has_error()) << i << " " << cur.str;
76 if (!err.has_error() && cur.success) { 76 if (!err.has_error() && cur.success) {
77 EXPECT_EQ(cur.expected_dir, result.dir().value()) 77 EXPECT_EQ(cur.expected_dir, result.dir().value())
78 << i << " " << cur.str; 78 << i << " " << cur.str;
79 EXPECT_EQ(cur.expected_name, result.name()) 79 EXPECT_EQ(cur.expected_name, result.name())
80 << i << " " << cur.str; 80 << i << " " << cur.str;
81 EXPECT_EQ(cur.expected_toolchain_dir, 81 EXPECT_EQ(cur.expected_toolchain_dir,
82 result.toolchain_dir().value()) 82 result.toolchain_dir().value())
83 << i << " " << cur.str; 83 << i << " " << cur.str;
84 EXPECT_EQ(cur.expected_toolchain_name, result.toolchain_name()) 84 EXPECT_EQ(cur.expected_toolchain_name, result.toolchain_name())
85 << i << " " << cur.str; 85 << i << " " << cur.str;
86 } 86 }
87 } 87 }
88 } 88 }
OLDNEW
« no previous file with comments | « third_party/cld/base/basictypes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698