OLD | NEW |
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 <stdint.h> |
| 6 |
5 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
6 #include "tools/gn/operators.h" | 8 #include "tools/gn/operators.h" |
7 #include "tools/gn/parse_tree.h" | 9 #include "tools/gn/parse_tree.h" |
8 #include "tools/gn/pattern.h" | 10 #include "tools/gn/pattern.h" |
9 #include "tools/gn/test_with_scope.h" | 11 #include "tools/gn/test_with_scope.h" |
10 | 12 |
11 namespace { | 13 namespace { |
12 | 14 |
13 bool IsValueIntegerEqualing(const Value& v, int64 i) { | 15 bool IsValueIntegerEqualing(const Value& v, int64_t i) { |
14 if (v.type() != Value::INTEGER) | 16 if (v.type() != Value::INTEGER) |
15 return false; | 17 return false; |
16 return v.int_value() == i; | 18 return v.int_value() == i; |
17 } | 19 } |
18 | 20 |
19 bool IsValueStringEqualing(const Value& v, const char* s) { | 21 bool IsValueStringEqualing(const Value& v, const char* s) { |
20 if (v.type() != Value::STRING) | 22 if (v.type() != Value::STRING) |
21 return false; | 23 return false; |
22 return v.string_value() == s; | 24 return v.string_value() == s; |
23 } | 25 } |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 196 |
195 // Set right as foo, but don't define a value for it. | 197 // Set right as foo, but don't define a value for it. |
196 const char foo[] = "foo"; | 198 const char foo[] = "foo"; |
197 Token identifier_token(Location(), Token::IDENTIFIER, foo); | 199 Token identifier_token(Location(), Token::IDENTIFIER, foo); |
198 node.set_right(scoped_ptr<ParseNode>(new IdentifierNode(identifier_token))); | 200 node.set_right(scoped_ptr<ParseNode>(new IdentifierNode(identifier_token))); |
199 | 201 |
200 Value ret = ExecuteBinaryOperator(setup.scope(), &node, node.left(), | 202 Value ret = ExecuteBinaryOperator(setup.scope(), &node, node.left(), |
201 node.right(), &err); | 203 node.right(), &err); |
202 EXPECT_FALSE(err.has_error()); | 204 EXPECT_FALSE(err.has_error()); |
203 } | 205 } |
OLD | NEW |