Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packed attribute affects decoding as well as encoding #330

Open
aeruder opened this issue Jun 24, 2016 · 1 comment
Open

Packed attribute affects decoding as well as encoding #330

aeruder opened this issue Jun 24, 2016 · 1 comment

Comments

@aeruder
Copy link

aeruder commented Jun 24, 2016

As described on the proto2 language guide under Options -> packed, the packed attribute should only be a cue for the encoder while the decoder should decode regardless.

I believe I've fixed this issue as well as a related issue (if receive a packed field and the decoder is expecting a non-repeated field, use the last occurrence in the encoded binary) on my forked repository. Now the crux of my problem: I want to write the tests.

Unfortunately I can't for the life of me figure out what I need to run the test. With protobuf 2.6.1, compile:rspec fails with problems related to the reserved keyword in the unittest .proto file. reserved was added in a protobuf 3.0 alpha release. If I move to the latest 3.0 release, I simply get an error that protoc won't generate ruby definitions with proto2 syntax.

So, question: what am I doing wrong? Are the rspec tests not being used? Is this something that should be addressed in google-protobuf upstream? Issues with ruby-protobuf? To be honest, I'd like to cleanup all the decoding logic to be a little simpler, but just don't know how to get the testsuite going so I can feel a bit more confident with those changes. Help?

@abrandoned
Copy link
Contributor

@aeruder the pb.rb files are in the repo and shouldn't need to be recompiled to run the specs ... I am on ruby-2.3.0 and just run bundle install && bundle exec rake spec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants