Refactor pmem tests