This bug only seems to happen if the line endings for all the files have 
been converted from Unix to DOS line endings.  In other words, the line 
endings have been changed from "\n" to "\r\n".  

Steps:
1) Download the latest version of Protocol Buffers (version 2.5.0)
2) Convert line endings from Unix to DOS.  In my particular case, I 
submitted the source to Perforce and it converted the file line endings. 
 Alternatively, you can use Notepad++ and do a find/replace in files to 
convert all the line endings.  There are also various utilities that will 
do the same thing.
3) Follow the directions and build everything using VS2010 and the solution 
files under "protobuf-2.5.0\vsprojects".
4) Run "tests" to verify your build.
5) You should encounter 3 project errors.

Tail of output:

[==========] 868 tests from 112 test cases ran. (10706 ms total)
[  PASSED  ] 865 tests.
[  FAILED  ] 3 tests, listed below:
[  FAILED  ] BootstrapTest.GeneratedDescriptorMatches
[  FAILED  ] TextFormatTest.Basic
[  FAILED  ] TextFormatExtensionsTest.Extensions


I suspect that the bootstrap test failure is related to the text format 
test failures, so I will focus on the text format error.

Here is the error message from one of the text format errors:

[ RUN      ] TextFormatTest.Basic
c:\projects\3rdparty\protocol_buffers\protobuf-2.5.0\src\google\protobuf\text_format_unittest.cc(121):
 
error: Value of: proto_.DebugString()
  Actual: "optional_int32: 101\noptional_int64: 102\noptional_uint32: 
103\noptional_uint64: 104\noptional_sint32: 105\noptional_sint64: 
106\noptional_fixed32: 107\noptional_fixed64: 108\noptional_sfixed32: 
109\noptional_sfixed64: 110\noptional_float: 111\noptional_double: 
112\noptional_bool: true\noptional_string: \"115\"\noptional_bytes: 
\"116\"\nOptionalGroup {\n  a: 117\n}\noptional_nested_message {\n  bb: 
118\n}\noptional_foreign_message {\n  c: 119\n}\noptional_import_message 
{\n  d: 120\n}\noptional_nested_enum: BAZ\noptional_foreign_enum: 
FOREIGN_BAZ\noptional_import_enum: IMPORT_BAZ\noptional_string_piece: 
\"124\"\noptional_cord: \"125\"\noptional_public_import_message {\n  e: 
126\n}\noptional_lazy_message {\n  bb: 127\n}\nrepeated_int32: 
201\nrepeated_int32: 301\nrepeated_int64: 202\nrepeated_int64: 
302\nrepeated_uint32: 203\nrepeated_uint32: 303\nrepeated_uint64: 
204\nrepeated_uint64: 304\nrepeated_sint32: 205\nrepeated_sint32: 
305\nrepeated_sint64: 206\nrepeated_sint64: 306\nrepeated_fixed32: 
207\nrepeated_fixed32: 307\nrepeated_fixed64: 208\nrepeated_fixed64: 
308\nrepeated_sfixed32: 209\nrepeated_sfixed32: 309\nrepeated_sfixed64: 
210\nrepeated_sfixed64: 310\nrepeated_float: 211\nrepeated_float: 
311\nrepeated_double: 212\nrepeated_double: 312\nrepeated_bool: 
true\nrepeated_bool: false\nrepeated_string: \"215\"\nrepeated_string: 
\"315\"\nrepeated_bytes: \"216\"\nrepeated_bytes: \"316\"\nRepeatedGroup 
{\n  a: 217\n}\nRepeatedGroup {\n  a: 317\n}\nrepeated_nested_message {\n 
 bb: 218\n}\nrepeated_nested_message {\n  bb: 
318\n}\nrepeated_foreign_message {\n  c: 219\n}\nrepeated_foreign_message 
{\n  c: 319\n}\nrepeated_import_message {\n  d: 
220\n}\nrepeated_import_message {\n  d: 320\n}\nrepeated_nested_enum: 
BAR\nrepeated_nested_enum: BAZ\nrepeated_foreign_enum: 
FOREIGN_BAR\nrepeated_foreign_enum: FOREIGN_BAZ\nrepeated_import_enum: 
IMPORT_BAR\nrepeated_import_enum: IMPORT_BAZ\nrepeated_string_piece: 
\"224\"\nrepeated_string_piece: \"324\"\nrepeated_cord: 
\"225\"\nrepeated_cord: \"325\"\nrepeated_lazy_message {\n  bb: 
227\n}\nrepeated_lazy_message {\n  bb: 327\n}\ndefault_int32: 
401\ndefault_int64: 402\ndefault_uint32: 403\ndefault_uint64: 
404\ndefault_sint32: 405\ndefault_sint64: 406\ndefault_fixed32: 
407\ndefault_fixed64: 408\ndefault_sfixed32: 409\ndefault_sfixed64: 
410\ndefault_float: 411\ndefault_double: 412\ndefault_bool: 
false\ndefault_string: \"415\"\ndefault_bytes: 
\"416\"\ndefault_nested_enum: FOO\ndefault_foreign_enum: 
FOREIGN_FOO\ndefault_import_enum: IMPORT_FOO\ndefault_string_piece: 
\"424\"\ndefault_cord: \"425\"\n"

 

Expected: proto_debug_string_
Which is: "optional_int32: 101\r\noptional_int64: 102\r\noptional_uint32: 
103\r\noptional_uint64: 104\r\noptional_sint32: 105\r\noptional_sint64: 106
\r\noptional_fixed32: 107\r\noptional_fixed64: 108\r\noptional_sfixed32: 109
\r\noptional_sfixed64: 110\r\noptional_float: 111\r\noptional_double: 
112\r\noptional_bool: 
true\r\noptional_string: \"115\"\r\noptional_bytes: \"116\"\r\nOptionalGroup 
{\r\n  a: 117\r\n}\r\noptional_nested_message {\r\n  bb: 
118\r\n}\r\noptional_foreign_message 
{\r\n  c: 119\r\n}\r\noptional_import_message {\r\n  d: 
120\r\n}\r\noptional_nested_enum: 
BAZ\r\noptional_foreign_enum: FOREIGN_BAZ\r\noptional_import_enum: 
IMPORT_BAZ\r\noptional_string_piece: \"124\"\r\noptional_cord: 
\"125\"\r\noptional_public_import_message {\r\n  e: 
126\r\n}\r\noptional_lazy_message {\r\n  bb: 127\r\n}\r\nrepeated_int32: 
201\r\nrepeated_int32: 301\r\nrepeated_int64: 202\r\nrepeated_int64: 
302\r\nrepeated_uint32: 203\r\nrepeated_uint32: 303\r\nrepeated_uint64: 
204\r\nrepeated_uint64: 304\r\nrepeated_sint32: 205\r\nrepeated_sint32: 
305\r\nrepeated_sint64: 206\r\nrepeated_sint64: 306\r\nrepeated_fixed32: 
207\r\nrepeated_fixed32: 307\r\nrepeated_fixed64: 208\r\nrepeated_fixed64: 
308\r\nrepeated_sfixed32: 209\r\nrepeated_sfixed32: 
309\r\nrepeated_sfixed64: 210\r\nrepeated_sfixed64: 310\r\nrepeated_float: 
211\r\nrepeated_float: 311\r\nrepeated_double: 212\r\nrepeated_double: 
312\r\nrepeated_bool: true\r\nrepeated_bool: false\r\nrepeated_string: 
\"215\"\r\nrepeated_string: \"315\"\r\nrepeated_bytes: 
\"216\"\r\nrepeated_bytes: \"316\"\r\nRepeatedGroup {\r\n  a: 
217\r\n}\r\nRepeatedGroup {\r\n  a: 317\r\n}\r\nrepeated_nested_message 
{\r\n  bb: 218\r\n}\r\nrepeated_nested_message {\r\n  bb: 
318\r\n}\r\nrepeated_foreign_message {\r\n  c: 
219\r\n}\r\nrepeated_foreign_message {\r\n  c: 
319\r\n}\r\nrepeated_import_message {\r\n  d: 
220\r\n}\r\nrepeated_import_message {\r\n  d: 
320\r\n}\r\nrepeated_nested_enum: BAR\r\nrepeated_nested_enum: 
BAZ\r\nrepeated_foreign_enum: FOREIGN_BAR\r\nrepeated_foreign_enum: 
FOREIGN_BAZ\r\nrepeated_import_enum: IMPORT_BAR\r\nrepeated_import_enum: 
IMPORT_BAZ\r\nrepeated_string_piece: \"224\"\r\nrepeated_string_piece: 
\"324\"\r\nrepeated_cord: \"225\"\r\nrepeated_cord: 
\"325\"\r\nrepeated_lazy_message {\r\n  bb: 
227\r\n}\r\nrepeated_lazy_message {\r\n  bb: 327\r\n}\r\ndefault_int32: 
401\r\ndefault_int64: 402\r\ndefault_uint32: 403\r\ndefault_uint64: 
404\r\ndefault_sint32: 405\r\ndefault_sint64: 406\r\ndefault_fixed32: 
407\r\ndefault_fixed64: 408\r\ndefault_sfixed32: 409\r\ndefault_sfixed64: 
410\r\ndefault_float: 411\r\ndefault_double: 412\r\ndefault_bool: 
false\r\ndefault_string: \"415\"\r\ndefault_bytes: 
\"416\"\r\ndefault_nested_enum: FOO\r\ndefault_foreign_enum: 
FOREIGN_FOO\r\ndefault_import_enum: IMPORT_FOO\r\ndefault_string_piece: 
\"424\"\r\ndefault_cord: \"425\"\r\n"
[  FAILED  ] TextFormatTest.Basic (10 ms)


I didn't mark all the differences, but you can see that the "\r" has been 
dropped from the "actual" result.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to