joshivineet / protobuf

Automatically exported from code.google.com/p/protobuf
Other
0 stars 0 forks source link

Descriptor->DebugString() does not print extensions to MessageOptions or FieldOptions #595

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile a .proto file with custom extensions to MessageOptions and/or or 
FieldOptions, e.g. network_ack.proto:

**********************************************************
import "goby/common/protobuf/option_extensions.proto";
import "dccl/protobuf/option_extensions.proto";

package goby.acomms.protobuf;

message NetworkAck
{
  option (dccl.msg).id = 6;
  option (dccl.msg).max_bytes = 32;

  required int32 message_src = 1 [(dccl.field).min = -1,
                                  (dccl.field).max = 30,
                                  (dccl.field).in_head = true]; 
  required int32 message_dest = 2 [(dccl.field).min = -1,
                                   (dccl.field).max = 30,
                                   (dccl.field).in_head = true];
  optional uint64 message_time = 3 [(dccl.field).codec = "_time",
                                    (dccl.field).in_head = true];

  required int32 message_dccl_id = 4 [(dccl.field).min = 0,
                                      (dccl.field).max = 0x7FFF];

  required int32 ack_src = 10 [(dccl.field).min = -1,
                               (dccl.field).max = 30,
                               (dccl.field).in_head = true];  

}
**********************************************************

2. Write out the DebugString() for that descriptor:
std::cout << 
goby::acomms::protobuf::NetworkAck::descriptor()->file()->DebugString();

What is the expected output? What do you see instead?
The expected output is the input .proto file (above) including the custom 
extensions. What I see instead is the input .proto file without the custom 
extensions:

**********************************************************
syntax = "proto2";

import "goby/common/protobuf/option_extensions.proto";
import "dccl/protobuf/option_extensions.proto";
package goby.acomms.protobuf;

message NetworkAck {
  required int32 message_src = 1;
  required int32 message_dest = 2;
  optional uint64 message_time = 3;
  required int32 message_dccl_id = 4;
  required int32 ack_src = 10;
}
**********************************************************

What version of the product are you using? On what operating system?
2.4.1, Ubuntu Linux 12.04

Original issue reported on code.google.com by tes.aube...@gmail.com on 8 Jan 2014 at 9:25

GoogleCodeExporter commented 9 years ago
After posting this, I read the changelog for 2.5.0 and it appears this bug has 
been fixed in that release.

Original comment by tes.aube...@gmail.com on 8 Jan 2014 at 9:34

GoogleCodeExporter commented 9 years ago

Original comment by jie...@google.com on 21 Jul 2014 at 4:44