foreignptr for Dataset and tests