Ported the self pointers test from C++.