ObjFW  Check-in [90a96b9682]

Overview
Comment:OFInvocationTests: Check for complex.h

__STDC_NO_COMPLEX__ is not defined if we have a C99 compiler in an
environment that doesn't support complex.

This fixes DJGPP.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 90a96b968201fba309b3b3284c725991daa4785f5e66cd11dc2a80a48c6dc6df
User & Date: js on 2018-02-11 14:55:29
Other Links: manifest | tags
Context
2018-02-11
15:12
Fix DJGPP's getcwd() returning forward slashes check-in: 86b1caa4d2 user: js tags: trunk
14:55
OFInvocationTests: Check for complex.h check-in: 90a96b9682 user: js tags: trunk
14:53
Remove useless #ifndef __STDC_NO_COMPLEX__ check-in: 869f4db107 user: js tags: trunk
Changes

Modified tests/OFInvocationTests.m from [c675d5e315] to [3eeb41421c].

16
17
18
19
20
21
22
23

24
25
26
27
28
29
30
16
17
18
19
20
21
22

23
24
25
26
27
28
29
30







-
+







 */

#include "config.h"

#include <assert.h>
#include <string.h>

#ifndef __STDC_NO_COMPLEX__
#if defined(HAVE_COMPLEX_H) && !defined(__STDC_NO_COMPLEX__)
# include <complex.h>
#endif

#import "OFInvocation.h"
#import "OFMethodSignature.h"
#import "OFAutoreleasePool.h"

126
127
128
129
130
131
132
133

134
135
136
137
138
139
140
126
127
128
129
130
131
132

133
134
135
136
137
138
139
140







-
+







				    : (long double)d15
				    : (long double)d16
{
	return (d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10 + d11 +
	    d12 + d13 + d14 + d15 + d16) / 16;
}

#ifndef __STDC_NO_COMPLEX__
#if defined(HAVE_COMPLEX_H) && !defined(__STDC_NO_COMPLEX__)
- (complex double)invocationTestMethod6: (complex float)c1
				       : (complex double)c2
				       : (complex float)c3
				       : (complex double)c4
				       : (complex float)c5
				       : (complex double)c6
				       : (complex float)c7
396
397
398
399
400
401
402
403

404
405
406
407
408
409
410
396
397
398
399
400
401
402

403
404
405
406
407
408
409
410







-
+








		long double longDoubleResult;
		TEST(@"-[invoke] #4", R([invocation invoke]) &&
		    R([invocation getReturnValue: &longDoubleResult]) &&
		    longDoubleResult == 8.5)
	}

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

	[invocation setArgument: &self
			atIndex: 0];