reorganize tests, ensure by value arguments always use their own memory