@@ -44,11 +44,16 @@ : (struct test_struct)st { return st; } -- (int)invocationTestMethod2: (int)i1 +- (void)invocationTestMethod2: (id)obj +{ + assert(obj == self); +} + +- (int)invocationTestMethod3: (int)i1 : (int)i2 : (int)i3 : (int)i4 : (int)i5 : (int)i6 @@ -65,11 +70,11 @@ { return (i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12 + i13 + i14 + i15 + i16) / 16; } -- (double)invocationTestMethod3: (double)d1 +- (double)invocationTestMethod4: (double)d1 : (double)d2 : (double)d3 : (double)d4 : (double)d5 : (double)d6 @@ -86,11 +91,11 @@ { return (d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10 + d11 + d12 + d13 + d14 + d15 + d16) / 16; } -- (float)invocationTestMethod4: (double)d1 +- (float)invocationTestMethod5: (double)d1 : (float)f2 : (float)f3 : (float)f4 : (float)f5 : (float)f6 @@ -107,11 +112,11 @@ { return (float)((d1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + d10 + f11 + f12 + f13 + f14 + f15 + f16) / 16); } -- (long double)invocationTestMethod5: (long double)d1 +- (long double)invocationTestMethod6: (long double)d1 : (long double)d2 : (long double)d3 : (long double)d4 : (long double)d5 : (long double)d6 @@ -129,11 +134,11 @@ return (d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10 + d11 + d12 + d13 + d14 + d15 + d16) / 16; } #if defined(HAVE_COMPLEX_H) && !defined(__STDC_NO_COMPLEX__) -- (complex double)invocationTestMethod6: (complex float)c1 +- (complex double)invocationTestMethod7: (complex float)c1 : (complex double)c2 : (complex float)c3 : (complex double)c4 : (complex float)c5 : (complex double)c6 @@ -167,11 +172,11 @@ return (c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 + c9 + c10 + c11 + c12 + c13 + c14 + c15 + c16) / 16; } -- (complex long double)invocationTestMethod7: (complex double)c1 +- (complex long double)invocationTestMethod8: (complex double)c1 : (complex float)c2 : (complex long double)c3 : (complex double)c4 : (complex float)c5 : (complex long double)c6 @@ -208,11 +213,11 @@ } #endif #ifdef __SIZEOF_INT128__ __extension__ -- (__int128)invocationTestMethod8: (int)i1 +- (__int128)invocationTestMethod9: (int)i1 : (__int128)i2 : (__int128)i3 : (__int128)i4 : (int)i5 : (__int128)i6 @@ -310,11 +315,25 @@ atIndex: 5]) && memcmp(&st, &st2, sizeof(st)) == 0) #ifdef OF_INVOCATION_CAN_INVOKE /* -[invoke] #1 */ - selector = @selector(invocationTestMethod2::::::::::::::::); + selector = @selector(invocationTestMethod2:); + invocation = [OFInvocation invocationWithMethodSignature: + [self methodSignatureForSelector: selector]]; + + [invocation setArgument: &self + atIndex: 0]; + [invocation setArgument: &selector + atIndex: 1]; + [invocation setArgument: &self + atIndex: 2]; + + TEST(@"-[invoke] #1", R([invocation invoke])) + + /* -[invoke] #2 */ + selector = @selector(invocationTestMethod3::::::::::::::::); invocation = [OFInvocation invocationWithMethodSignature: [self methodSignatureForSelector: selector]]; [invocation setArgument: &self atIndex: 0]; @@ -324,15 +343,15 @@ for (int j = 1; j <= 16; j++) [invocation setArgument: &j atIndex: j + 1]; int intResult; - TEST(@"-[invoke] #1", R([invocation invoke]) && + TEST(@"-[invoke] #2", R([invocation invoke]) && R([invocation getReturnValue: &intResult]) && intResult == 8) - /* -[invoke] #2 */ - selector = @selector(invocationTestMethod3::::::::::::::::); + /* -[invoke] #3 */ + selector = @selector(invocationTestMethod4::::::::::::::::); invocation = [OFInvocation invocationWithMethodSignature: [self methodSignatureForSelector: selector]]; [invocation setArgument: &self atIndex: 0]; @@ -344,16 +363,16 @@ [invocation setArgument: &d atIndex: j + 1]; } double doubleResult; - TEST(@"-[invoke] #2", R([invocation invoke]) && + TEST(@"-[invoke] #3", R([invocation invoke]) && R([invocation getReturnValue: &doubleResult]) && doubleResult == 8.5) - /* -[invoke] #3 */ - selector = @selector(invocationTestMethod4::::::::::::::::); + /* -[invoke] #4 */ + selector = @selector(invocationTestMethod5::::::::::::::::); invocation = [OFInvocation invocationWithMethodSignature: [self methodSignatureForSelector: selector]]; [invocation setArgument: &self atIndex: 0]; @@ -371,17 +390,17 @@ [invocation setArgument: &f atIndex: j + 1]; } float floatResult; - TEST(@"-[invoke] #3", R([invocation invoke]) && + TEST(@"-[invoke] #4", R([invocation invoke]) && R([invocation getReturnValue: &floatResult]) && floatResult == 8.5) /* Only when encoding long doubles is supported */ if (strcmp(@encode(double), @encode(long double)) != 0) { - /* -[invoke] #4 */ - selector = @selector(invocationTestMethod5::::::::::::::::); + /* -[invoke] #5 */ + selector = @selector(invocationTestMethod6::::::::::::::::); invocation = [OFInvocation invocationWithMethodSignature: [self methodSignatureForSelector: selector]]; [invocation setArgument: &self atIndex: 0]; @@ -393,18 +412,18 @@ [invocation setArgument: &d atIndex: j + 1]; } long double longDoubleResult; - TEST(@"-[invoke] #4", R([invocation invoke]) && + TEST(@"-[invoke] #5", R([invocation invoke]) && R([invocation getReturnValue: &longDoubleResult]) && longDoubleResult == 8.5) } # if defined(HAVE_COMPLEX_H) && !defined(__STDC_NO_COMPLEX__) - /* -[invoke] #5 */ - selector = @selector(invocationTestMethod6::::::::::::::::); + /* -[invoke] #6 */ + selector = @selector(invocationTestMethod7::::::::::::::::); invocation = [OFInvocation invocationWithMethodSignature: [self methodSignatureForSelector: selector]]; [invocation setArgument: &self atIndex: 0]; @@ -422,19 +441,19 @@ [invocation setArgument: &cd atIndex: j + 1]; } complex double complexDoubleResult; - TEST(@"-[invoke] #5", R([invocation invoke]) && + TEST(@"-[invoke] #6", R([invocation invoke]) && R([invocation getReturnValue: &complexDoubleResult]) && complexDoubleResult == 8.5 + 4.25 * I) /* Only when encoding complex long doubles is supported */ if (strcmp(@encode(complex double), @encode(complex long double)) != 0) { - /* -[invoke] #6 */ - selector = @selector(invocationTestMethod7::::::::::::::::); + /* -[invoke] #7 */ + selector = @selector(invocationTestMethod8::::::::::::::::); invocation = [OFInvocation invocationWithMethodSignature: [self methodSignatureForSelector: selector]]; [invocation setArgument: &self atIndex: 0]; @@ -461,19 +480,19 @@ break; } } complex long double complexLongDoubleResult; - TEST(@"-[invoke] #6", R([invocation invoke]) && + TEST(@"-[invoke] #7", R([invocation invoke]) && R([invocation getReturnValue: &complexLongDoubleResult]) && complexLongDoubleResult == 8.5 + 4.25 * I) } # endif # ifdef __SIZEOF_INT128__ - /* -[invoke] #7 */ - selector = @selector(invocationTestMethod8::::::::::::::::); + /* -[invoke] #8 */ + selector = @selector(invocationTestMethod9::::::::::::::::); invocation = [OFInvocation invocationWithMethodSignature: [self methodSignatureForSelector: selector]]; [invocation setArgument: &self atIndex: 0]; @@ -492,15 +511,15 @@ [invocation setArgument: &i128 atIndex: j + 1]; } __extension__ __int128 int128Result; - TEST(@"-[invoke] #7", R([invocation invoke]) && + TEST(@"-[invoke] #8", R([invocation invoke]) && R([invocation getReturnValue: &int128Result]) && int128Result == __extension__ ((__int128)0xFFFFFFFFFFFFFFFF << 64) + 8) # endif #endif [pool drain]; } @end