ObjFW  Diff

Differences From Artifact [1bbbdf67b6]:

To Artifact [852b660a9a]:


251
252
253
254
255
256
257
258

259
260
261
262
263
264
265
}
#endif

- (void)invocationTests
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	SEL selector = @selector(invocationTestMethod1::::);
	OFMethodSignature *sig = [self methodSignatureForSelector: selector];

	OFInvocation *invocation;
	struct test_struct st, st2, *stp = &st, *stp2;
	unsigned const char c = 0xAA;
	unsigned char c2;
	const unsigned int i = 0x55555555;
	unsigned int i2;








|
>







251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
}
#endif

- (void)invocationTests
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	SEL selector = @selector(invocationTestMethod1::::);
	OFMethodSignature *sig =
	    (OFMethodSignature *)[self methodSignatureForSelector: selector];
	OFInvocation *invocation;
	struct test_struct st, st2, *stp = &st, *stp2;
	unsigned const char c = 0xAA;
	unsigned char c2;
	const unsigned int i = 0x55555555;
	unsigned int i2;

309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
							      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];

	for (int i = 1; i <= 16; i++)
		[invocation setArgument: &i
				atIndex: i + 1];

	int intResult;
	TEST(@"-[invoke] #1", R([invocation invoke]) &&
	    R([invocation getReturnValue: &intResult]) && intResult == 8)

	/* -[invoke] #2 */
	selector = @selector(invocationTestMethod3::::::::::::::::);
	invocation = [OFInvocation invocationWithMethodSignature:
	    [self methodSignatureForSelector: selector]];

	[invocation setArgument: &self
			atIndex: 0];
	[invocation setArgument: &selector
			atIndex: 1];

	for (int i = 1; i <= 16; i++) {
		double d = i;
		[invocation setArgument: &d
				atIndex: i + 1];
	}

	double doubleResult;
	TEST(@"-[invoke] #2", R([invocation invoke]) &&
	    R([invocation getReturnValue: &doubleResult]) &&
	    doubleResult == 8.5)

	/* -[invoke] #3 */
	selector = @selector(invocationTestMethod4::::::::::::::::);
	invocation = [OFInvocation invocationWithMethodSignature:
	    [self methodSignatureForSelector: selector]];

	[invocation setArgument: &self
			atIndex: 0];
	[invocation setArgument: &selector
			atIndex: 1];

	for (int i = 1; i <= 16; i++) {







|

















|




















|







310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
							      atIndex: 5]) &&
	    memcmp(&st, &st2, sizeof(st)) == 0)

#ifdef OF_INVOCATION_CAN_INVOKE
	/* -[invoke] #1 */
	selector = @selector(invocationTestMethod2::::::::::::::::);
	invocation = [OFInvocation invocationWithMethodSignature:
	    (OFMethodSignature *)[self methodSignatureForSelector: selector]];

	[invocation setArgument: &self
			atIndex: 0];
	[invocation setArgument: &selector
			atIndex: 1];

	for (int i = 1; i <= 16; i++)
		[invocation setArgument: &i
				atIndex: i + 1];

	int intResult;
	TEST(@"-[invoke] #1", R([invocation invoke]) &&
	    R([invocation getReturnValue: &intResult]) && intResult == 8)

	/* -[invoke] #2 */
	selector = @selector(invocationTestMethod3::::::::::::::::);
	invocation = [OFInvocation invocationWithMethodSignature:
	    (OFMethodSignature *)[self methodSignatureForSelector: selector]];

	[invocation setArgument: &self
			atIndex: 0];
	[invocation setArgument: &selector
			atIndex: 1];

	for (int i = 1; i <= 16; i++) {
		double d = i;
		[invocation setArgument: &d
				atIndex: i + 1];
	}

	double doubleResult;
	TEST(@"-[invoke] #2", R([invocation invoke]) &&
	    R([invocation getReturnValue: &doubleResult]) &&
	    doubleResult == 8.5)

	/* -[invoke] #3 */
	selector = @selector(invocationTestMethod4::::::::::::::::);
	invocation = [OFInvocation invocationWithMethodSignature:
	    (OFMethodSignature *)[self methodSignatureForSelector: selector]];

	[invocation setArgument: &self
			atIndex: 0];
	[invocation setArgument: &selector
			atIndex: 1];

	for (int i = 1; i <= 16; i++) {
376
377
378
379
380
381
382

383
384
385
386
387
388
389
	    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::::::::::::::::);
		invocation = [OFInvocation invocationWithMethodSignature:

		    [self methodSignatureForSelector: selector]];

		[invocation setArgument: &self
				atIndex: 0];
		[invocation setArgument: &selector
				atIndex: 1];








>







377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
	    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::::::::::::::::);
		invocation = [OFInvocation invocationWithMethodSignature:
		    (OFMethodSignature *)
		    [self methodSignatureForSelector: selector]];

		[invocation setArgument: &self
				atIndex: 0];
		[invocation setArgument: &selector
				atIndex: 1];

399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
		    longDoubleResult == 8.5)
	}

# ifndef __STDC_NO_COMPLEX__
	/* -[invoke] #5 */
	selector = @selector(invocationTestMethod6::::::::::::::::);
	invocation = [OFInvocation invocationWithMethodSignature:
	    [self methodSignatureForSelector: selector]];

	[invocation setArgument: &self
			atIndex: 0];
	[invocation setArgument: &selector
			atIndex: 1];

	for (int i = 1; i <= 16; i++) {







|







401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
		    longDoubleResult == 8.5)
	}

# ifndef __STDC_NO_COMPLEX__
	/* -[invoke] #5 */
	selector = @selector(invocationTestMethod6::::::::::::::::);
	invocation = [OFInvocation invocationWithMethodSignature:
	    (OFMethodSignature *)[self methodSignatureForSelector: selector]];

	[invocation setArgument: &self
			atIndex: 0];
	[invocation setArgument: &selector
			atIndex: 1];

	for (int i = 1; i <= 16; i++) {
429
430
431
432
433
434
435

436
437
438
439
440
441
442

	/* Only when encoding complex long doubles is supported */
	if (strcmp(@encode(complex double),
	    @encode(complex long double)) != 0) {
		/* -[invoke] #6 */
		selector = @selector(invocationTestMethod7::::::::::::::::);
		invocation = [OFInvocation invocationWithMethodSignature:

		    [self methodSignatureForSelector: selector]];

		[invocation setArgument: &self
				atIndex: 0];
		[invocation setArgument: &selector
				atIndex: 1];








>







431
432
433
434
435
436
437
438
439
440
441
442
443
444
445

	/* Only when encoding complex long doubles is supported */
	if (strcmp(@encode(complex double),
	    @encode(complex long double)) != 0) {
		/* -[invoke] #6 */
		selector = @selector(invocationTestMethod7::::::::::::::::);
		invocation = [OFInvocation invocationWithMethodSignature:
		    (OFMethodSignature *)
		    [self methodSignatureForSelector: selector]];

		[invocation setArgument: &self
				atIndex: 0];
		[invocation setArgument: &selector
				atIndex: 1];

468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
	}
# endif

# ifdef __SIZEOF_INT128__
	/* -[invoke] #7 */
	selector = @selector(invocationTestMethod8::::::::::::::::);
	invocation = [OFInvocation invocationWithMethodSignature:
	    [self methodSignatureForSelector: selector]];

	[invocation setArgument: &self
			atIndex: 0];
	[invocation setArgument: &selector
			atIndex: 1];

	for (int i = 1; i <= 16; i++) {







|







471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
	}
# endif

# ifdef __SIZEOF_INT128__
	/* -[invoke] #7 */
	selector = @selector(invocationTestMethod8::::::::::::::::);
	invocation = [OFInvocation invocationWithMethodSignature:
	    (OFMethodSignature *)[self methodSignatureForSelector: selector]];

	[invocation setArgument: &self
			atIndex: 0];
	[invocation setArgument: &selector
			atIndex: 1];

	for (int i = 1; i <= 16; i++) {