@@ -309,213 +309,8 @@ TEST(@"-[getArgument:atIndex:] #4", R([invocation getArgument: &st2 atIndex: 5]) && memcmp(&st, &st2, sizeof(st)) == 0) -#ifdef OF_INVOCATION_CAN_INVOKE - /* -[invoke] #1 */ - 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]; - [invocation setArgument: &selector - atIndex: 1]; - - for (int j = 1; j <= 16; j++) - [invocation setArgument: &j - atIndex: j + 1]; - - int intResult; - TEST(@"-[invoke] #2", R([invocation invoke]) && - R([invocation getReturnValue: &intResult]) && intResult == 8) - - /* -[invoke] #3 */ - selector = @selector(invocationTestMethod4::::::::::::::::); - invocation = [OFInvocation invocationWithMethodSignature: - [self methodSignatureForSelector: selector]]; - - [invocation setArgument: &self - atIndex: 0]; - [invocation setArgument: &selector - atIndex: 1]; - - for (int j = 1; j <= 16; j++) { - double d = j; - [invocation setArgument: &d - atIndex: j + 1]; - } - - double doubleResult; - TEST(@"-[invoke] #3", R([invocation invoke]) && - R([invocation getReturnValue: &doubleResult]) && - doubleResult == 8.5) - - /* -[invoke] #4 */ - selector = @selector(invocationTestMethod5::::::::::::::::); - invocation = [OFInvocation invocationWithMethodSignature: - [self methodSignatureForSelector: selector]]; - - [invocation setArgument: &self - atIndex: 0]; - [invocation setArgument: &selector - atIndex: 1]; - - for (int j = 1; j <= 16; j++) { - float f = j; - double d = j; - - if (j == 1 || j == 10) - [invocation setArgument: &d - atIndex: j + 1]; - else - [invocation setArgument: &f - atIndex: j + 1]; - } - - float floatResult; - 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] #5 */ - selector = @selector(invocationTestMethod6::::::::::::::::); - invocation = [OFInvocation invocationWithMethodSignature: - [self methodSignatureForSelector: selector]]; - - [invocation setArgument: &self - atIndex: 0]; - [invocation setArgument: &selector - atIndex: 1]; - - for (int j = 1; j <= 16; j++) { - long double d = j; - [invocation setArgument: &d - atIndex: j + 1]; - } - - long double longDoubleResult; - TEST(@"-[invoke] #5", R([invocation invoke]) && - R([invocation getReturnValue: &longDoubleResult]) && - longDoubleResult == 8.5) - } - -# if defined(HAVE_COMPLEX_H) && !defined(__STDC_NO_COMPLEX__) - /* -[invoke] #6 */ - selector = @selector(invocationTestMethod7::::::::::::::::); - invocation = [OFInvocation invocationWithMethodSignature: - [self methodSignatureForSelector: selector]]; - - [invocation setArgument: &self - atIndex: 0]; - [invocation setArgument: &selector - atIndex: 1]; - - for (int j = 1; j <= 16; j++) { - complex float cf = j + 0.5 * j * I; - complex double cd = j + 0.5 * j * I; - - if (j & 1) - [invocation setArgument: &cf - atIndex: j + 1]; - else - [invocation setArgument: &cd - atIndex: j + 1]; - } - - complex double complexDoubleResult; - 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] #7 */ - selector = @selector(invocationTestMethod8::::::::::::::::); - invocation = [OFInvocation invocationWithMethodSignature: - [self methodSignatureForSelector: selector]]; - - [invocation setArgument: &self - atIndex: 0]; - [invocation setArgument: &selector - atIndex: 1]; - - for (int j = 1; j <= 16; j++) { - complex double cd = j + 0.5 * j * I; - complex float cf = j + 0.5 * j * I; - complex long double cld = j + 0.5 * j * I; - - switch (j % 3) { - case 0: - [invocation setArgument: &cld - atIndex: j + 1]; - break; - case 1: - [invocation setArgument: &cd - atIndex: j + 1]; - break; - case 2: - [invocation setArgument: &cf - atIndex: j + 1]; - break; - } - } - - complex long double complexLongDoubleResult; - TEST(@"-[invoke] #7", R([invocation invoke]) && - R([invocation getReturnValue: &complexLongDoubleResult]) && - complexLongDoubleResult == 8.5 + 4.25 * I) - } -# endif - -# ifdef __SIZEOF_INT128__ - /* -[invoke] #8 */ - selector = @selector(invocationTestMethod9::::::::::::::::); - invocation = [OFInvocation invocationWithMethodSignature: - [self methodSignatureForSelector: selector]]; - - [invocation setArgument: &self - atIndex: 0]; - [invocation setArgument: &selector - atIndex: 1]; - - for (int j = 1; j <= 16; j++) { - __extension__ __int128 i128 = 0xFFFFFFFFFFFFFFFF; - i128 <<= 64; - i128 |= j; - - if (j == 1 || j == 5) - [invocation setArgument: &j - atIndex: j + 1]; - else - [invocation setArgument: &i128 - atIndex: j + 1]; - } - - __extension__ __int128 int128Result; - TEST(@"-[invoke] #8", R([invocation invoke]) && - R([invocation getReturnValue: &int128Result]) && - int128Result == __extension__ ((__int128)0xFFFFFFFFFFFFFFFF << 64) + - 8) -# endif -#endif - [pool drain]; } @end