aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArslaan Pathan <[email protected]>2026-10-03 23:04:55 +1300
committerArslaan Pathan <[email protected]>2026-10-03 23:04:55 +1300
commit9c8f390995ace83ebee758ba42fc7f77da2129e2 (patch)
treeeead5bdc7e57503287e91d9b41dcf9db83adcbad /tests
parent845aa9ce0bdbc64bc5890c719ae6016740836c0c (diff)
downloadParadox-9c8f390995ace83ebee758ba42fc7f77da2129e2.tar.xz
Paradox-9c8f390995ace83ebee758ba42fc7f77da2129e2.zip
Selector test and tweak Introspection (yay it works!)
Diffstat (limited to 'tests')
-rw-r--r--tests/Introspection.m5
-rw-r--r--tests/Selector.m25
2 files changed, 29 insertions, 1 deletions
diff --git a/tests/Introspection.m b/tests/Introspection.m
index 2bdc6f9..dd6a061 100644
--- a/tests/Introspection.m
+++ b/tests/Introspection.m
@@ -8,7 +8,7 @@
@implementation MyClass
- (void)sayHello {
- printf("Hello!");
+ printf("Hello!\n");
}
@end
@@ -23,4 +23,7 @@ int main(void) {
printf("isMemberOfClass:PXObject = %s\n", [instance isMemberOfClass:[PXObject class]] ? "YES" : "NO");
printf("isKindOfClass:MyClass = %s\n", [instance isKindOfClass:[MyClass class]] ? "YES" : "NO");
printf("isKindOfClass:PXObject = %s\n", [instance isKindOfClass:[PXObject class]] ? "YES" : "NO");
+
+ [instance release];
+ printf("test complete\n");
}
diff --git a/tests/Selector.m b/tests/Selector.m
new file mode 100644
index 0000000..0cc33e4
--- /dev/null
+++ b/tests/Selector.m
@@ -0,0 +1,25 @@
+#include <Paradox/Core.h>
+#include <stdio.h>
+
+@interface MyClass : PXObject
+- (void)sayHello;
+@end
+
+@implementation MyClass
+
+- (void)sayHello {
+ printf("Hello!\n");
+}
+
+@end
+
+int main(void) {
+ printf("Selector test\n");
+ MyClass *instance = [MyClass new];
+
+ printf("respondsToSelector:sayHello = %s\n", [instance respondsToSelector:@selector(sayHello)] ? "YES" : "NO");
+ printf("respondsToSelector:sayGoodbye = %s\n", [instance respondsToSelector:@selector(sayGoodbye)] ? "YES" : "NO");
+ printf("respondsToSelector:retain = %s\n", [instance respondsToSelector:@selector(retain)] ? "YES" : "NO");
+
+ [instance release];
+}