VirtualBox

Changeset 39142 in vbox


Ignore:
Timestamp:
Oct 28, 2011 3:03:35 PM (13 years ago)
Author:
vboxsync
Message:

And more.

File:
1 edited

Legend:

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

    r39141 r39142  
    112112            if (u32A != uChangedValue)
    113113                pszError = "Writing changed value failed";
     114            else
     115            {
     116                u32A = *uPtrReg.pu32;
     117                if (u32A != uInitialValue)
     118                    pszError = "Restore error 1";
     119            }
    114120        }
    115121        else
     
    120126         * Write byte changes.
    121127         */
    122         if (!pszError)
    123         {
    124 
    125         }
    126 
     128        for (unsigned iByte = 0; !pszError && iByte < 4; iByte)
     129        {
     130            /* Change the value. */
     131            uPtrReg.pu8[iByte] = (uint8_t)(uChangedValue >> iByte * 8);
     132            u32A = *uPtrReg.pu32;
     133            *uPtrReg.pu32 = uInitialValue;
     134            if (u32A != (uChangedValue & UINT32_C(0xff) << iByte * 8))
     135            {
     136                static const char * const s_apsz[] = { "byte 0", "byte 1", "byte 2", "byte 3" };
     137                pszError = s_apsz[iByte];
     138            }
     139            else
     140            {
     141                u32A = *uPtrReg.pu32;
     142                if (u32A != uInitialValue)
     143                    pszError = "Restore error 2";
     144            }
     145        }
    127146
    128147        *uPtrReg.pu32 = uInitialValue;
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