add a test case for discardOwnership
discardOwnership from scriptwrapper