Changes in src/tests/polymorphism.c [3787dc1:1f370451]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/polymorphism.c
r3787dc1 r1f370451 47 47 S s; 48 48 s.i = i; 49 assert (s.i == i);49 assertf(s.i == i, "struct operation fails in polymorphic context."); 50 50 51 51 B b; … … 73 73 { 74 74 // test aggregates with polymorphic members 75 typedef uint32_t x_type;76 typedef uint64_t y_type;75 typedef __attribute__((aligned(8))) uint32_t x_type; 76 typedef __attribute__((aligned(8))) uint64_t y_type; 77 77 78 78 x_type x = 3; … … 89 89 // ensure that the size of aggregates with polymorphic members 90 90 // matches the size of the aggregates in a monomorphic context 91 assert( struct_size(x, y) == sizeof(S) ); 92 assert( union_size(x, y) == sizeof(U) ); 91 size_t ssz = struct_size(x, y); 92 size_t usz = union_size(x, y); 93 assertf( ssz == sizeof(S), "struct size differs in polymorphic context: %zd / %zd", ssz, sizeof(S)); 94 assertf( usz == sizeof(U), "union size differs in polymorphic context: %zd / %zd", usz, sizeof(U)); 93 95 94 96 y_type ?=?(y_type & this, zero_t) { … … 111 113 u.f2 = 0; 112 114 u.f1 = x; 113 assert (ret == u.f2);115 assertf(ret == u.f2, "union operation fails in polymorphic context."); 114 116 } 115 117 }
Note: See TracChangeset
for help on using the changeset viewer.