changed casting of ptr to uintptr_t
added Basic test