| Index: tools/gn/input_conversion_unittest.cc
|
| diff --git a/tools/gn/input_conversion_unittest.cc b/tools/gn/input_conversion_unittest.cc
|
| index 65c31fb38ba333f7719541164b587a3cd4e18010..0c2c1c9a6a4a33c9e122fcc64945fb72091723a5 100644
|
| --- a/tools/gn/input_conversion_unittest.cc
|
| +++ b/tools/gn/input_conversion_unittest.cc
|
| @@ -31,15 +31,15 @@ class InputConversionTest : public testing::Test {
|
| TEST_F(InputConversionTest, String) {
|
| Err err;
|
| std::string input("\nfoo bar \n");
|
| - Value result = ConvertInputToValue(settings(), input, NULL,
|
| - Value(NULL, "string"), &err);
|
| + Value result = ConvertInputToValue(settings(), input, nullptr,
|
| + Value(nullptr, "string"), &err);
|
| EXPECT_FALSE(err.has_error());
|
| EXPECT_EQ(Value::STRING, result.type());
|
| EXPECT_EQ(input, result.string_value());
|
|
|
| // Test with trimming.
|
| - result = ConvertInputToValue(settings(), input, NULL,
|
| - Value(NULL, "trim string"), &err);
|
| + result = ConvertInputToValue(settings(), input, nullptr,
|
| + Value(nullptr, "trim string"), &err);
|
| EXPECT_FALSE(err.has_error());
|
| EXPECT_EQ(Value::STRING, result.type());
|
| EXPECT_EQ("foo bar", result.string_value());
|
| @@ -48,8 +48,8 @@ TEST_F(InputConversionTest, String) {
|
| TEST_F(InputConversionTest, ListLines) {
|
| Err err;
|
| std::string input("\nfoo\nbar \n\n");
|
| - Value result = ConvertInputToValue(settings(), input, NULL,
|
| - Value(NULL, "list lines"), &err);
|
| + Value result = ConvertInputToValue(settings(), input, nullptr,
|
| + Value(nullptr, "list lines"), &err);
|
| EXPECT_FALSE(err.has_error());
|
| EXPECT_EQ(Value::LIST, result.type());
|
| ASSERT_EQ(4u, result.list_value().size());
|
| @@ -59,8 +59,8 @@ TEST_F(InputConversionTest, ListLines) {
|
| EXPECT_EQ("", result.list_value()[3].string_value());
|
|
|
| // Test with trimming.
|
| - result = ConvertInputToValue(settings(), input, NULL,
|
| - Value(NULL, "trim list lines"), &err);
|
| + result = ConvertInputToValue(settings(), input, nullptr,
|
| + Value(nullptr, "trim list lines"), &err);
|
| EXPECT_FALSE(err.has_error());
|
| EXPECT_EQ(Value::LIST, result.type());
|
| ASSERT_EQ(2u, result.list_value().size());
|
| @@ -71,8 +71,8 @@ TEST_F(InputConversionTest, ListLines) {
|
| TEST_F(InputConversionTest, ValueString) {
|
| Err err;
|
| std::string input("\"str\"");
|
| - Value result = ConvertInputToValue(settings(), input, NULL,
|
| - Value(NULL, "value"), &err);
|
| + Value result = ConvertInputToValue(settings(), input, nullptr,
|
| + Value(nullptr, "value"), &err);
|
| EXPECT_FALSE(err.has_error());
|
| EXPECT_EQ(Value::STRING, result.type());
|
| EXPECT_EQ("str", result.string_value());
|
| @@ -81,8 +81,8 @@ TEST_F(InputConversionTest, ValueString) {
|
| TEST_F(InputConversionTest, ValueInt) {
|
| Err err;
|
| std::string input("\n\n 6 \n ");
|
| - Value result = ConvertInputToValue(settings(), input, NULL,
|
| - Value(NULL, "value"), &err);
|
| + Value result = ConvertInputToValue(settings(), input, nullptr,
|
| + Value(nullptr, "value"), &err);
|
| EXPECT_FALSE(err.has_error());
|
| EXPECT_EQ(Value::INTEGER, result.type());
|
| EXPECT_EQ(6, result.int_value());
|
| @@ -91,8 +91,8 @@ TEST_F(InputConversionTest, ValueInt) {
|
| TEST_F(InputConversionTest, ValueList) {
|
| Err err;
|
| std::string input("\n [ \"a\", 5]");
|
| - Value result = ConvertInputToValue(settings(), input, NULL,
|
| - Value(NULL, "value"), &err);
|
| + Value result = ConvertInputToValue(settings(), input, nullptr,
|
| + Value(nullptr, "value"), &err);
|
| EXPECT_FALSE(err.has_error());
|
| ASSERT_EQ(Value::LIST, result.type());
|
| ASSERT_EQ(2u, result.list_value().size());
|
| @@ -103,8 +103,8 @@ TEST_F(InputConversionTest, ValueList) {
|
| TEST_F(InputConversionTest, ValueDict) {
|
| Err err;
|
| std::string input("\n a = 5 b = \"foo\" c = a + 2");
|
| - Value result = ConvertInputToValue(settings(), input, NULL,
|
| - Value(NULL, "scope"), &err);
|
| + Value result = ConvertInputToValue(settings(), input, nullptr,
|
| + Value(nullptr, "scope"), &err);
|
| EXPECT_FALSE(err.has_error());
|
| ASSERT_EQ(Value::SCOPE, result.type());
|
|
|
| @@ -134,8 +134,8 @@ TEST_F(InputConversionTest, ValueDict) {
|
|
|
| TEST_F(InputConversionTest, ValueEmpty) {
|
| Err err;
|
| - Value result = ConvertInputToValue(settings(), "", NULL,
|
| - Value(NULL, "value"), &err);
|
| + Value result = ConvertInputToValue(settings(), "", nullptr,
|
| + Value(nullptr, "value"), &err);
|
| EXPECT_FALSE(err.has_error());
|
| EXPECT_EQ(Value::NONE, result.type());
|
| }
|
| @@ -143,20 +143,20 @@ TEST_F(InputConversionTest, ValueEmpty) {
|
| TEST_F(InputConversionTest, ValueError) {
|
| Err err;
|
| std::string input("\n [ \"a\", 5\nfoo bar");
|
| - Value result = ConvertInputToValue(settings(), input, NULL,
|
| - Value(NULL, "value"), &err);
|
| + Value result = ConvertInputToValue(settings(), input, nullptr,
|
| + Value(nullptr, "value"), &err);
|
| EXPECT_TRUE(err.has_error());
|
|
|
| // Blocks not allowed.
|
| input = "{ foo = 5 }";
|
| - result = ConvertInputToValue(settings(), input, NULL,
|
| - Value(NULL, "value"), &err);
|
| + result = ConvertInputToValue(settings(), input, nullptr,
|
| + Value(nullptr, "value"), &err);
|
| EXPECT_TRUE(err.has_error());
|
|
|
| // Function calls not allowed.
|
| input = "print(5)";
|
| - result = ConvertInputToValue(settings(), input, NULL,
|
| - Value(NULL, "value"), &err);
|
| + result = ConvertInputToValue(settings(), input, nullptr,
|
| + Value(nullptr, "value"), &err);
|
| EXPECT_TRUE(err.has_error());
|
| }
|
|
|
| @@ -164,11 +164,12 @@ TEST_F(InputConversionTest, ValueError) {
|
| // result.
|
| TEST_F(InputConversionTest, Ignore) {
|
| Err err;
|
| - Value result = ConvertInputToValue(settings(), "foo", NULL, Value(), &err);
|
| + Value result = ConvertInputToValue(settings(), "foo", nullptr, Value(), &err);
|
| EXPECT_FALSE(err.has_error());
|
| EXPECT_EQ(Value::NONE, result.type());
|
|
|
| - result = ConvertInputToValue(settings(), "foo", NULL, Value(NULL, ""), &err);
|
| + result =
|
| + ConvertInputToValue(settings(), "foo", nullptr, Value(nullptr, ""), &err);
|
| EXPECT_FALSE(err.has_error());
|
| EXPECT_EQ(Value::NONE, result.type());
|
| }
|
|
|