[protobuf] Manual Updates/Corrections

2017-04-07 Thread shgayle
In the encoding section of the manual:

https://developers.google.com/protocol-buffers/docs/encoding

For the 'Test1 message and set a to 150'

the example states the code would read:

08 96 01

Shouldn't this be: 08 150 01 (1000, 10010110, 0001) -> (0001, 
10010110 [001+0010110])

08 (Tag 1 and Type 0 varint)

150 (22 with MSB set)

01 (128 bit from prior byte at first bit, MSB not set)

Just looking for some clarification since I can't see 96 anywhere in the 
example.

Thanks.

-- 
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 https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Javascript with Protobuf FileDescriptorSet and what is equivalent to DynamicMessage.parse(FileDescriptor, byte[] payload) ?

2017-04-07 Thread Vijay Balakrishnan
Hi,
Newbie to protobuf and pardon my naivete on this topic.

I would like to use protoc --descriptor_set_out=out.desc  -js_out=
import_style=commonjs,error_on_name_conflict,binary:.  mymessage.proto

I have code to upload this out.desc to my server to S3. using out.desc as I 
want multiple clients to upload their separate descriptor files to me
I have a node.js micro-service and want to be able to handle a byte[] 
payload using this out.desc. The micro-service receives a key along with 
the byte[] payload. I use the key on the backend to identify the out.desc 
filedescriptor to use.
In Java, I can use DynamicMessage.parse(FileDescriptor, byte[] payload) to 
do this after identifying the relevant desc file using a key to connect the 
client to the desc file.

How do i do this in javascript or node.js ?

TIA,
Vijay

-- 
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 https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Is possible to use enum from external class in .proto files?

2017-04-07 Thread ronil . merchant
Hi, on the same lines need help on an idea.

Is it possible to define my enums in one .proto file and use them across 
other .proto files.
In context of grpc protobuf3.

Any help is appreciated.

On Friday, December 7, 2012 at 10:49:29 AM UTC+5:30, Henner Zeller wrote:
>
> On 6 December 2012 15:32, Milan Stankovic  > wrote:
>
>> Is possible to use enum from external class ? I have couple .proto 
>> definition and all need to use same enum Type with same tokens. I want to 
>> avoid definition of same enum in every class and to avoid sync between, I 
>> have that enum in regular external c++ class which I use in code.
>
>
> It is not possible to have an external C++ enum somewhere, as this would 
> require the proto parser to parse C++.
>
> However, what I usually do in that case is to define my enumeration in a 
> separate *.proto file
> myenums.proto ---
> enum Foo {
>a = 1;
>b = 2;
>c = 3;
> };
>
> enum Bar {
> x = 1;
> } 
> --
>
> from this, you can generate a myenums.pb.h - it essentially contains the 
> enumerations as you would write them in C++ anyway, and some useful 
> conversion functions (e.g. that convert it to a printable version).
> (also, this would generate enumeration for other languages as well, if you 
> need it). From there, you can just use these enums as any other enums.
>
> Also, in your other proto-buffer files, you then can import this file and 
>  use the enumeration
>
> otherprotofile.proto 
> import "myenmus.proto";
>
> message MyMessage {
>   Foo foo_enum = 1;
> };
> --
>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Protocol Buffers" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/protobuf/-/H0dBbyOrwrgJ.
>> To post to this group, send email to prot...@googlegroups.com 
>> .
>> To unsubscribe from this group, send email to 
>> protobuf+u...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/protobuf?hl=en.
>>
>
>

-- 
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 https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] (3.2.0) Reporting Test Suite Failure on OpenBSD

2017-04-07 Thread Brad DeMorrow
I believe this is the same dump that has been reported for solaris boxes
under issue 1755:
https://github.com/google/protobuf/issues/1755

I will chime in on that issue as well, but I wanted to report here since
that's what the test suite says to do.

Thank you all,
Log attached and bt from core dump below:


(gdb) bt
#0  0x0cb218ab7d14 in testing::Sequence::AddExpectation () from
./.libs/libgmock.so.0.0
#1  0x0caf7b43acfb in
testing::internal::MockSpec::InternalExpectedAt ()
   from /usr/ports/pobj/protobuf-3.2.0/build-amd64/src/.libs/protobuf-test
#2  0x0caf7b440525 in
google::protobuf::util::converter::ExpectingObjectWriter::RenderBool ()
   from /usr/ports/pobj/protobuf-3.2.0/build-amd64/src/.libs/protobuf-test
#3  0x0caf7b45a3c6 in
google::protobuf::util::converter::JsonStreamParserTest_SimpleTrue_Test::TestBody
()
   from /usr/ports/pobj/protobuf-3.2.0/build-amd64/src/.libs/protobuf-test
#4  0x0cb2059dd271 in
testing::internal::HandleExceptionsInMethodIfSupported
() from ./.libs/libgtest.so.0.0
#5  0x0cb2059d394a in testing::Test::Run () from ./.libs/libgtest.so.0.0
#6  0x0cb1f2b9a600 in ?? ()
#7  0x0cb20fab6c00 in ?? ()
#8  0x0cb23aab0bc0 in ?? ()
#9  0x0cb2059d3a98 in testing::TestInfo::Run () from
./.libs/libgtest.so.0.0
#10 0x0cb1bf4c1198 in ?? ()
#11 0x0001 in ?? ()
#12 0x0cb25d7b1d00 in ?? ()
#13 0x0cb20fab6c00 in ?? ()
#14 0x0cb23aab0bc0 in ?? ()
#15 0x0cb2059b70a0 in testing::TestCase::total_test_count () from
./.libs/libgtest.so.0.0
#16 0x015b484fe103 in ?? ()
#17 0x0cb2059d3b75 in testing::TestCase::Run () from
./.libs/libgtest.so.0.0
#18 0x0cb2059d3e88 in testing::internal::UnitTestImpl::RunAllTests ()
from ./.libs/libgtest.so.0.0
#19 0x0795 in ?? ()
#20 0x0001 in ?? ()
#21 0x0cb1fe304a4e in _dl_bind (object=0x0, index=Variable "index" is
not available.
) at /usr/src/libexec/ld.so/amd64/rtld_machine.c:357
#22 0x0cb205afac48 in testing::internal::kStackTraceMarker () from
./.libs/libgtest.so.0.0
#23 0x in ?? ()

-- 
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 https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

   Protocol Buffers 3.2.0: src/test-suite.log


# TOTAL: 7
# PASS:  6
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: protobuf-test
===

Running main() from gmock_main.cc
[==] Running 1941 tests from 187 test cases.
[--] Global test environment set-up.
[--] 6 tests from DescriptorPoolTypeResolverTest
[ RUN  ] DescriptorPoolTypeResolverTest.TestAllTypes
[   OK ] DescriptorPoolTypeResolverTest.TestAllTypes (6 ms)
[ RUN  ] DescriptorPoolTypeResolverTest.TestPackedField
[   OK ] DescriptorPoolTypeResolverTest.TestPackedField (0 ms)
[ RUN  ] DescriptorPoolTypeResolverTest.TestOneof
[   OK ] DescriptorPoolTypeResolverTest.TestOneof (0 ms)
[ RUN  ] DescriptorPoolTypeResolverTest.TestMap
[   OK ] DescriptorPoolTypeResolverTest.TestMap (2 ms)
[ RUN  ] DescriptorPoolTypeResolverTest.TestEnum
[   OK ] DescriptorPoolTypeResolverTest.TestEnum (0 ms)
[ RUN  ] DescriptorPoolTypeResolverTest.TestJsonName
[   OK ] DescriptorPoolTypeResolverTest.TestJsonName (1 ms)
[--] 6 tests from DescriptorPoolTypeResolverTest (10 ms total)

[--] 8 tests from TimeUtilTest
[ RUN  ] TimeUtilTest.TimestampStringFormat
[   OK ] TimeUtilTest.TimestampStringFormat (1 ms)
[ RUN  ] TimeUtilTest.DurationStringFormat
[   OK ] TimeUtilTest.DurationStringFormat (0 ms)
[ RUN  ] TimeUtilTest.GetEpoch
[   OK ] TimeUtilTest.GetEpoch (0 ms)
[ RUN  ] TimeUtilTest.DurationIntegerConversion
[   OK ] TimeUtilTest.DurationIntegerConversion (0 ms)
[ RUN  ] TimeUtilTest.TimeTConversion
[   OK ] TimeUtilTest.TimeTConversion (0 ms)
[ RUN  ] TimeUtilTest.TimevalConversion
[   OK ] TimeUtilTest.TimevalConversion (0 ms)
[ RUN  ] TimeUtilTest.DurationOperators
[   OK ] TimeUtilTest.DurationOperators (0 ms)
[ RUN  ] TimeUtilTest.TimestampOperators
[   OK ] TimeUtilTest.TimestampOperators (0 ms)
[--] 8 tests from TimeUtilTest (2 ms total)

[--] 1 test from TestUtilTest
[ RUN  ] TestUtilTest.TimestampIntegerConversion
[   OK ] TestUtilTest.TimestampIntegerConversion (0 ms)
[--] 1 test from TestUtilTest (0 ms total)

[--] 73 tests from MessageDifferencerTest
[ RUN