Testing struct works for memory allocation