sel.m 534 B

123456789101112131415161718192021
  1. /*
  2. TEST_BUILD_OUTPUT
  3. .*sel.m:\d+:\d+: warning: null passed to a callee that requires a non-null argument \[-Wnonnull\](\n.* note: expanded from macro 'testassert')?
  4. END
  5. */
  6. #include "test.h"
  7. #include <string.h>
  8. #include <objc/objc-runtime.h>
  9. #include <objc/objc-auto.h>
  10. int main()
  11. {
  12. // Make sure @selector values are correctly fixed up
  13. testassert(@selector(foo) == sel_registerName("foo"));
  14. // sel_getName recognizes the zero SEL
  15. testassert(0 == strcmp("<null selector>", sel_getName(0)));
  16. succeed(__FILE__);
  17. }