Re: [protobuf] Re: Why does SerializeToArray returns true (Eventhough required fieds are missing)

2016-07-01 Thread 'Adam Cozzette' via Protocol Buffers
Note that SerializeToArray performs an assertion to check that the all required fields are present: https://github.com/google/protobuf/blob/master/src/google/protobuf/message_lite.cc#L321 But GOOGLE_DCHECK assertions are not enabled for optimized builds since they take effect only if NDEBUG is not

Re: [protobuf] Re: Why does SerializeToArray returns true (Eventhough required fieds are missing)

2016-07-01 Thread 'Bo Yang' via Protocol Buffers
You can call IsInitialized on Message On Fri, Jul 1, 2016 at 2:50 PM SAMEER CHAUDHARI < sameer.m.chaudh...@gmail.com> wrote: > I am using protobuf ver 2.6. > > Also what is the best way to check all required fields are present before > serialize Message. > Instead of checking every required