add test prim; fix buf for adj matrix