Test buffer allocation