From d75197375876538332d6d81aa4e8edd13b8f26c1 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Tue, 5 Jan 2010 17:42:05 -0800 Subject: Ported/fixed tests to new data types. --- src/upb_data.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/upb_data.c') diff --git a/src/upb_data.c b/src/upb_data.c index 58aee8a..1bb76aa 100644 --- a/src/upb_data.c +++ b/src/upb_data.c @@ -290,13 +290,17 @@ static union upb_value_ptr get_value_ptr(upb_msg *msg, struct upb_fielddef *f) if(upb_isarray(f)) { if(!upb_msg_has(msg, f)) { if(!*p.arr || !upb_data_only(*p.data)) { + printf("Initializing array field " UPB_STRFMT "\n", UPB_STRARG(f->name)); if(*p.arr) upb_array_unref(*p.arr, f); *p.arr = upb_array_new(); + } else { + printf("REUSING array field " UPB_STRFMT "\n", UPB_STRARG(f->name)); } upb_array_truncate(*p.arr); upb_msg_sethas(msg, f); } else { + printf("APPENDING TO EXISTING array field " UPB_STRFMT "\n", UPB_STRARG(f->name)); assert(*p.arr); } upb_arraylen_t oldlen = upb_array_len(*p.arr); -- cgit v1.2.3