VirtualBox

Ignore:
Timestamp:
Mar 22, 2021 8:59:46 PM (4 years ago)
Author:
vboxsync
Message:

ValidationKit/tdStorageSnapshotMerging1: pylint-2.x points out that the
expression 'uOrigCrc = 0xa8f5daa3' redefines 'uOrigCrc' to a long since
the value 0xa8f5daa3 exceeds MAX_INT. Thus specify 'uOrigCrc' and
'uResCrc32' (which is promoted to 'long' in the comparison 'if uResCrc32

uOrigCrc') as long data types and then include the Python3

compatibility hack of 'long = int' since Python3 dropped support for the
'long' data type.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/storage/tdStorageSnapshotMerging1.py

    r82968 r88254  
    4848from testdriver import vboxcon;
    4949from testdriver import vboxwrappers;
     50
     51# Python 3 hacks:
     52if sys.version_info[0] >= 3:
     53    long = int;     # pylint: disable=redefined-builtin,invalid-name
    5054
    5155
     
    284288        fFmtDynamic = oDskFmt.id == 'VDI';
    285289        sOrigWithDiffHd = '5.3/storage/mergeMedium/t-fixed.vdi'
    286         uOrigCrc = 0x7a417cbb;
     290        uOrigCrc = long(0x7a417cbb);
    287291
    288292        if fFmtDynamic:
    289293            sOrigWithDiffHd = '5.3/storage/mergeMedium/t-resized.vdi';
    290             uOrigCrc = 0xa8f5daa3;
     294            uOrigCrc = long(0xa8f5daa3);
    291295
    292296        oOrigWithDiffHd = self.openMedium(sOrigWithDiffHd);
     
    343347                    fRc = fRc and self.cloneMedium(oHd, oResHd);
    344348
    345                     uResCrc32 = 0;
     349                    uResCrc32 = long(0);
    346350                    if fRc:
    347                         uResCrc32 = crc32_of_file(sResFilePathRaw);
     351                        uResCrc32 = long(crc32_of_file(sResFilePathRaw));
    348352                        if uResCrc32 == uOrigCrc:
    349353                            reporter.log('Snapshot merged successfully. Crc32 is correct');
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