1 /* 2 * Tests if this still compiles when multiple .proto files are involved. 3 */ 4 5 #include <stdio.h> 6 #include <pb_encode.h> 7 #include <pb_common.h> 8 #include "unittests.h" 9 #include "multifile2.pb.h" 10 #include "subdir/multifile2.pb.h" 11 main()12int main() 13 { 14 int status = 0; 15 16 /* Test that included file options are properly loaded */ 17 TEST(OneofMessage_size == 27); 18 19 /* Check that enum signedness is detected properly */ 20 { 21 pb_field_iter_t iter; 22 Enums msg; 23 TEST(pb_field_iter_begin(&iter, Enums_fields, &msg)); 24 TEST(PB_LTYPE(iter.type) == PB_LTYPE_VARINT); 25 TEST(pb_field_iter_next(&iter)); 26 TEST(PB_LTYPE(iter.type) == PB_LTYPE_UVARINT); 27 } 28 29 /* Test that subdir file is correctly included */ 30 { 31 subdir_SubdirMessage foo = subdir_SubdirMessage_init_default; 32 TEST(foo.foo == 15); 33 TEST(subdir_OneofMessage_size >= 27); /* Note: not perfectly accurate due to issue 172 */ 34 TEST(subdir_OneofMessage_size <= 30); 35 } 36 37 return status; 38 } 39