diff options
author | Nobuaki Sukegawa <nsukeg@gmail.com> | 2014-11-30 19:42:51 +0900 |
---|---|---|
committer | Nobuaki Sukegawa <nsukeg@gmail.com> | 2014-12-03 23:05:45 +0900 |
commit | 8ba0e3576491596f0bc40cc1159641f8910edf2a (patch) | |
tree | 2da2afad7ede42d7d4330ea979970b48421400c2 /src | |
parent | 77931993f4fbb6f7e46327934e1f65c2b4f247eb (diff) |
Make test code runnable with C++11
Preprocessor token right after string literal without whitespace results
in parse failure in C++11.
Diffstat (limited to 'src')
-rw-r--r-- | src/google/protobuf/compiler/command_line_interface_unittest.cc | 2 | ||||
-rw-r--r-- | src/google/protobuf/compiler/parser_unittest.cc | 58 | ||||
-rw-r--r-- | src/google/protobuf/stubs/common_unittest.cc | 14 |
3 files changed, 37 insertions, 37 deletions
diff --git a/src/google/protobuf/compiler/command_line_interface_unittest.cc b/src/google/protobuf/compiler/command_line_interface_unittest.cc index f4606c8d..dbaaa405 100644 --- a/src/google/protobuf/compiler/command_line_interface_unittest.cc +++ b/src/google/protobuf/compiler/command_line_interface_unittest.cc @@ -725,7 +725,7 @@ TEST_F(CommandLineInterfaceTest, ColonDelimitedPath) { #endif Run("protocol_compiler --test_out=$tmpdir " - "--proto_path=$tmpdir/a"PATH_SEPARATOR"$tmpdir/b foo.proto"); + "--proto_path=$tmpdir/a" PATH_SEPARATOR "$tmpdir/b foo.proto"); #undef PATH_SEPARATOR diff --git a/src/google/protobuf/compiler/parser_unittest.cc b/src/google/protobuf/compiler/parser_unittest.cc index 45f95df1..638a83b9 100644 --- a/src/google/protobuf/compiler/parser_unittest.cc +++ b/src/google/protobuf/compiler/parser_unittest.cc @@ -379,35 +379,35 @@ TEST_F(ParseMessageTest, FieldDefaults) { #define ETC "name:\"foo\" label:LABEL_REQUIRED number:1" "message_type {" " name: \"TestMessage\"" - " field { type:TYPE_INT32 default_value:\"1\" "ETC" }" - " field { type:TYPE_INT32 default_value:\"-2\" "ETC" }" - " field { type:TYPE_INT64 default_value:\"3\" "ETC" }" - " field { type:TYPE_INT64 default_value:\"-4\" "ETC" }" - " field { type:TYPE_UINT32 default_value:\"5\" "ETC" }" - " field { type:TYPE_UINT64 default_value:\"6\" "ETC" }" - " field { type:TYPE_FLOAT default_value:\"7.5\" "ETC" }" - " field { type:TYPE_FLOAT default_value:\"-8.5\" "ETC" }" - " field { type:TYPE_FLOAT default_value:\"9\" "ETC" }" - " field { type:TYPE_DOUBLE default_value:\"10.5\" "ETC" }" - " field { type:TYPE_DOUBLE default_value:\"-11.5\" "ETC" }" - " field { type:TYPE_DOUBLE default_value:\"12\" "ETC" }" - " field { type:TYPE_DOUBLE default_value:\"inf\" "ETC" }" - " field { type:TYPE_DOUBLE default_value:\"-inf\" "ETC" }" - " field { type:TYPE_DOUBLE default_value:\"nan\" "ETC" }" - " field { type:TYPE_STRING default_value:\"13\\001\" "ETC" }" - " field { type:TYPE_STRING default_value:\"abc\" "ETC" }" - " field { type:TYPE_BYTES default_value:\"14\\\\002\" "ETC" }" - " field { type:TYPE_BYTES default_value:\"abc\" "ETC" }" - " field { type:TYPE_BOOL default_value:\"true\" "ETC" }" - " field { type_name:\"Foo\" default_value:\"FOO\" "ETC" }" - - " field { type:TYPE_INT32 default_value:\"2147483647\" "ETC" }" - " field { type:TYPE_INT32 default_value:\"-2147483648\" "ETC" }" - " field { type:TYPE_UINT32 default_value:\"4294967295\" "ETC" }" - " field { type:TYPE_INT64 default_value:\"9223372036854775807\" "ETC" }" - " field { type:TYPE_INT64 default_value:\"-9223372036854775808\" "ETC" }" - " field { type:TYPE_UINT64 default_value:\"18446744073709551615\" "ETC" }" - " field { type:TYPE_DOUBLE default_value:\"43981\" "ETC" }" + " field { type:TYPE_INT32 default_value:\"1\" " ETC " }" + " field { type:TYPE_INT32 default_value:\"-2\" " ETC " }" + " field { type:TYPE_INT64 default_value:\"3\" " ETC " }" + " field { type:TYPE_INT64 default_value:\"-4\" " ETC " }" + " field { type:TYPE_UINT32 default_value:\"5\" " ETC " }" + " field { type:TYPE_UINT64 default_value:\"6\" " ETC " }" + " field { type:TYPE_FLOAT default_value:\"7.5\" " ETC " }" + " field { type:TYPE_FLOAT default_value:\"-8.5\" " ETC " }" + " field { type:TYPE_FLOAT default_value:\"9\" " ETC " }" + " field { type:TYPE_DOUBLE default_value:\"10.5\" " ETC " }" + " field { type:TYPE_DOUBLE default_value:\"-11.5\" " ETC " }" + " field { type:TYPE_DOUBLE default_value:\"12\" " ETC " }" + " field { type:TYPE_DOUBLE default_value:\"inf\" " ETC " }" + " field { type:TYPE_DOUBLE default_value:\"-inf\" " ETC " }" + " field { type:TYPE_DOUBLE default_value:\"nan\" " ETC " }" + " field { type:TYPE_STRING default_value:\"13\\001\" " ETC " }" + " field { type:TYPE_STRING default_value:\"abc\" " ETC " }" + " field { type:TYPE_BYTES default_value:\"14\\\\002\" " ETC " }" + " field { type:TYPE_BYTES default_value:\"abc\" " ETC " }" + " field { type:TYPE_BOOL default_value:\"true\" " ETC " }" + " field { type_name:\"Foo\" default_value:\"FOO\" " ETC " }" + + " field { type:TYPE_INT32 default_value:\"2147483647\" " ETC " }" + " field { type:TYPE_INT32 default_value:\"-2147483648\" " ETC " }" + " field { type:TYPE_UINT32 default_value:\"4294967295\" " ETC " }" + " field { type:TYPE_INT64 default_value:\"9223372036854775807\" " ETC " }" + " field { type:TYPE_INT64 default_value:\"-9223372036854775808\" " ETC " }" + " field { type:TYPE_UINT64 default_value:\"18446744073709551615\" " ETC " }" + " field { type:TYPE_DOUBLE default_value:\"43981\" " ETC " }" "}"); #undef ETC } diff --git a/src/google/protobuf/stubs/common_unittest.cc b/src/google/protobuf/stubs/common_unittest.cc index 7eb4e317..5f458e98 100644 --- a/src/google/protobuf/stubs/common_unittest.cc +++ b/src/google/protobuf/stubs/common_unittest.cc @@ -95,9 +95,9 @@ TEST(LoggingTest, DefaultLogging) { string text = GetCapturedTestStderr(); EXPECT_EQ( - "[libprotobuf INFO "__FILE__":" + SimpleItoa(line + 1) + "] A message.\n" - "[libprotobuf WARNING "__FILE__":" + SimpleItoa(line + 2) + "] A warning.\n" - "[libprotobuf ERROR "__FILE__":" + SimpleItoa(line + 3) + "] An error.\n", + "[libprotobuf INFO " __FILE__ ":" + SimpleItoa(line + 1) + "] A message.\n" + "[libprotobuf WARNING " __FILE__ ":" + SimpleItoa(line + 2) + "] A warning.\n" + "[libprotobuf ERROR " __FILE__ ":" + SimpleItoa(line + 3) + "] An error.\n", text); } @@ -128,10 +128,10 @@ TEST(LoggingTest, CaptureLogging) { ASSERT_EQ(2, captured_messages_.size()); EXPECT_EQ( - "2 "__FILE__":" + SimpleItoa(start_line + 1) + ": An error.", + "2 " __FILE__ ":" + SimpleItoa(start_line + 1) + ": An error.", captured_messages_[0]); EXPECT_EQ( - "1 "__FILE__":" + SimpleItoa(start_line + 2) + ": A warning.", + "1 " __FILE__ ":" + SimpleItoa(start_line + 2) + ": A warning.", captured_messages_[1]); } @@ -154,10 +154,10 @@ TEST(LoggingTest, SilenceLogging) { ASSERT_EQ(2, captured_messages_.size()); EXPECT_EQ( - "0 "__FILE__":" + SimpleItoa(line1) + ": Visible1", + "0 " __FILE__ ":" + SimpleItoa(line1) + ": Visible1", captured_messages_[0]); EXPECT_EQ( - "0 "__FILE__":" + SimpleItoa(line2) + ": Visible2", + "0 " __FILE__ ":" + SimpleItoa(line2) + ": Visible2", captured_messages_[1]); } |