VirtualBox

Changeset 26308 in vbox


Ignore:
Timestamp:
Feb 5, 2010 7:14:35 PM (15 years ago)
Author:
vboxsync
Message:

tstDeviceStructSize: qualified the output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/testcase/tstDeviceStructSize.cpp

    r25946 r26308  
    109109        if (off != RT_OFFSETOF(type, m)) \
    110110        { \
    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); \
    112112            rc++; \
    113113        } \
     
    125125        if (size != sizeof(type)) \
    126126        { \
    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)); \
    128128            rc++; \
    129129        } \
    130130        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)); \
    132132    } while (0)
    133133
     
    140140        if (RT_OFFSETOF(strct, member) & ((align) - 1) ) \
    141141        { \
    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", \
    143143                   #strct, #member, \
    144144                   (unsigned)RT_OFFSETOF(strct, member), \
     
    158158        if (RT_ALIGN_Z(sizeof(type), (align)) != sizeof(type)) \
    159159        { \
    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", \
    161161                   #type, \
    162162                   (unsigned)sizeof(type), \
     
    178178        if (sizeof(p->member.s) > sizeof(p->member.padding)) \
    179179        { \
    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, \
    181181                   (int)sizeof(p->member.padding), (int)sizeof(p->member.s), (int)RT_ALIGN_Z(sizeof(p->member.s), (align))); \
    182182            rc++; \
     
    184184        else if (RT_ALIGN_Z(sizeof(p->member.padding), (align)) != sizeof(p->member.padding)) \
    185185        { \
    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, \
    187187                   (int)sizeof(p->member.padding), (int)RT_ALIGN_Z(sizeof(p->member.s), (align))); \
    188188            rc++; \
     
    199199        if (sizeof(p->s) > sizeof(p->padding)) \
    200200        { \
    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, \
    202202                   (int)sizeof(p->padding), (int)sizeof(p->s), (int)RT_ALIGN_Z(sizeof(p->s), 32)); \
    203203            rc++; \
     
    214214        if (sizeof(p->member) > sizeof(p->pad_member)) \
    215215        { \
    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, \
    217217                   (int)sizeof(p->pad_member), (int)sizeof(p->member)); \
    218218            rc++; \
     
    226226    do \
    227227    { \
    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)); \
    229229    } while (0)
    230230
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette