6 using namespace nanopb;
8#if __cplusplus >= 201103L
9 static_assert(MessageDescriptor<MyEmptyMessage>::fields_array_length == 0,
10 "Unexpected field length");
11 static_assert(MessageDescriptor<MyNonEmptyMessage>::fields_array_length == 1,
12 "Unexpected field length");
17 TEST(MessageDescriptor<MyEmptyMessage>::fields_array_length ==
18 MyEmptyMessage_msg.field_count);
19 TEST(MessageDescriptor<MyNonEmptyMessage>::fields_array_length ==
20 MyNonEmptyMessage_msg.field_count);
22 TEST(MessageDescriptor<MyNonEmptyMessage>::size ==
23 MyNonEmptyMessage_size);
24 TEST(MessageDescriptor<MyMessageWithSizeBoundRepeatedFields>::size ==
25 MyMessageWithSizeBoundRepeatedFields_size);
27 TEST(MessageDescriptor<MyEmptyMessage>::fields() == MyEmptyMessage_fields);
28 TEST(MessageDescriptor<MyNonEmptyMessage>::fields() ==
29 MyNonEmptyMessage_fields);
31 TEST(MessageDescriptor<MyMessageWithMsgid>::has_msgid() ==
true);
32 TEST(MessageDescriptor<MyMessageWithMsgid>::msgid() == 42);
34 TEST(MessageDescriptor<MyMessageWithoutMsgid>::has_msgid() ==
false);
37 if (status != 0) fprintf(
stdout,
"\n\nSome tests FAILED!\n");