Changeset 26308 in vbox
- Timestamp:
- Feb 5, 2010 7:14:35 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/testcase/tstDeviceStructSize.cpp
r25946 r26308 109 109 if (off != RT_OFFSETOF(type, m)) \ 110 110 { \ 111 printf(" %#010x %s Off by %d!! (off=%#x)\n", RT_OFFSETOF(type, m), #type "." #m, off - RT_OFFSETOF(type, m), off); \111 printf("tstDeviceStructSize: error! %#010x %s Off by %d!! (off=%#x)\n", RT_OFFSETOF(type, m), #type "." #m, off - RT_OFFSETOF(type, m), off); \ 112 112 rc++; \ 113 113 } \ … … 125 125 if (size != sizeof(type)) \ 126 126 { \ 127 printf(" sizeof(%s): %#x (%d) Off by %d!!\n", #type, (int)sizeof(type), (int)sizeof(type), (int)(sizeof(type) - size)); \127 printf("tstDeviceStructSize: error! sizeof(%s): %#x (%d) Off by %d!!\n", #type, (int)sizeof(type), (int)sizeof(type), (int)(sizeof(type) - size)); \ 128 128 rc++; \ 129 129 } \ 130 130 else \ 131 printf(" sizeof(%s): %#x (%d)\n", #type, (int)sizeof(type), (int)sizeof(type)); \131 printf("tstDeviceStructSize: info: sizeof(%s): %#x (%d)\n", #type, (int)sizeof(type), (int)sizeof(type)); \ 132 132 } while (0) 133 133 … … 140 140 if (RT_OFFSETOF(strct, member) & ((align) - 1) ) \ 141 141 { \ 142 printf(" %s::%s offset=%#x (%u) expected alignment %x, meaning %#x (%u) off\n", \142 printf("tstDeviceStructSize: error! %s::%s offset=%#x (%u) expected alignment %x, meaning %#x (%u) off\n", \ 143 143 #strct, #member, \ 144 144 (unsigned)RT_OFFSETOF(strct, member), \ … … 158 158 if (RT_ALIGN_Z(sizeof(type), (align)) != sizeof(type)) \ 159 159 { \ 160 printf(" %s size=%#x (%u), align=%#x %#x (%u) bytes off\n", \160 printf("tstDeviceStructSize: error! %s size=%#x (%u), align=%#x %#x (%u) bytes off\n", \ 161 161 #type, \ 162 162 (unsigned)sizeof(type), \ … … 178 178 if (sizeof(p->member.s) > sizeof(p->member.padding)) \ 179 179 { \ 180 printf(" padding of %s::%s is too small, padding=%d struct=%d correct=%d\n", #strct, #member, \180 printf("tstDeviceStructSize: error! padding of %s::%s is too small, padding=%d struct=%d correct=%d\n", #strct, #member, \ 181 181 (int)sizeof(p->member.padding), (int)sizeof(p->member.s), (int)RT_ALIGN_Z(sizeof(p->member.s), (align))); \ 182 182 rc++; \ … … 184 184 else if (RT_ALIGN_Z(sizeof(p->member.padding), (align)) != sizeof(p->member.padding)) \ 185 185 { \ 186 printf(" padding of %s::%s is misaligned, padding=%d correct=%d\n", #strct, #member, \186 printf("tstDeviceStructSize: error! padding of %s::%s is misaligned, padding=%d correct=%d\n", #strct, #member, \ 187 187 (int)sizeof(p->member.padding), (int)RT_ALIGN_Z(sizeof(p->member.s), (align))); \ 188 188 rc++; \ … … 199 199 if (sizeof(p->s) > sizeof(p->padding)) \ 200 200 { \ 201 printf(" padding of %s is too small, padding=%d struct=%d correct=%d\n", #strct, \201 printf("tstDeviceStructSize: error! padding of %s is too small, padding=%d struct=%d correct=%d\n", #strct, \ 202 202 (int)sizeof(p->padding), (int)sizeof(p->s), (int)RT_ALIGN_Z(sizeof(p->s), 32)); \ 203 203 rc++; \ … … 214 214 if (sizeof(p->member) > sizeof(p->pad_member)) \ 215 215 { \ 216 printf(" padding of %s::%s is too small, padding=%d struct=%d\n", #strct, #member, \216 printf("tstDeviceStructSize: error! padding of %s::%s is too small, padding=%d struct=%d\n", #strct, #member, \ 217 217 (int)sizeof(p->pad_member), (int)sizeof(p->member)); \ 218 218 rc++; \ … … 226 226 do \ 227 227 { \ 228 printf(" %s::%s offset %d sizeof %d\n", #strct, #member, (int)RT_OFFSETOF(strct, member), (int)RT_SIZEOFMEMB(strct, member)); \228 printf("tstDeviceStructSize: info: %s::%s offset %d sizeof %d\n", #strct, #member, (int)RT_OFFSETOF(strct, member), (int)RT_SIZEOFMEMB(strct, member)); \ 229 229 } while (0) 230 230
Note:
See TracChangeset
for help on using the changeset viewer.