26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
#import "TestsAppDelegate.h"
static OFString *module = @"OFMethodSignature";
struct test1_struct {
char c;
int i;
};
struct test2_struct {
char c;
struct {
short s;
int i;
} st;
union {
char c;
int i;
} u;
long double d;
};
union test3_union {
char c;
int i;
long double d;
};
union test4_union {
char c;
struct {
short x, y;
} st;
int i;
union {
float f;
long double d;
} u;
};
@implementation TestsAppDelegate (OFMethodSignatureTests)
- (void)methodSignatureTests
{
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
>
|
|
|
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
#import "TestsAppDelegate.h"
static OFString *module = @"OFMethodSignature";
struct test1_struct {
char c;
int i;
char d;
};
struct test2_struct {
char c;
struct {
short s;
int i;
} st;
union {
char c;
int i;
} u;
double d;
};
union test3_union {
char c;
int i;
double d;
};
union test4_union {
char c;
struct {
short x, y;
} st;
int i;
union {
float f;
double d;
} u;
};
@implementation TestsAppDelegate (OFMethodSignatureTests)
- (void)methodSignatureTests
{
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
of_sizeof_type_encoding(@encode(union test4_union)) ==
sizeof(union test4_union))
TEST(@"of_sizeof_type_encoding() #5",
of_sizeof_type_encoding(@encode(struct test1_struct [5])) ==
sizeof(struct test1_struct [5]))
TEST(@"of_alignof() #1",
of_alignof_type_encoding(@encode(struct test1_struct)) ==
OF_ALIGNOF(struct test1_struct))
TEST(@"of_alignof_type_encoding() #2",
of_alignof_type_encoding(@encode(struct test2_struct)) ==
OF_ALIGNOF(struct test2_struct))
|
|
|
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
of_sizeof_type_encoding(@encode(union test4_union)) ==
sizeof(union test4_union))
TEST(@"of_sizeof_type_encoding() #5",
of_sizeof_type_encoding(@encode(struct test1_struct [5])) ==
sizeof(struct test1_struct [5]))
TEST(@"of_alignof_type_encoding() #1",
of_alignof_type_encoding(@encode(struct test1_struct)) ==
OF_ALIGNOF(struct test1_struct))
TEST(@"of_alignof_type_encoding() #2",
of_alignof_type_encoding(@encode(struct test2_struct)) ==
OF_ALIGNOF(struct test2_struct))
|