reimplementing unbox_value in c test