VirtualBox

Changeset 90243 in vbox


Ignore:
Timestamp:
Jul 19, 2021 3:46:31 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145781
Message:

testdriver/vbox.py: Fix floating point rounding issues (0.1 is known to be tricky...) which showed up for 6.1.97. Also, the API version correction was incorrect for pre-release versions of the next major API release.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testdriver/vbox.py

    r86627 r90243  
    14131413                                    % (sVer, aiVerComponents[2]));
    14141414
    1415             # Convert the three integers into a floating point value.  The API is table witin a
     1415            # Convert the three integers into a floating point value.  The API is stable within a
    14161416            # x.y release, so the third component only indicates whether it's a stable or
    14171417            # development build of the next release.
    14181418            self.fpApiVer = aiVerComponents[0] + 0.1 * aiVerComponents[1];
    14191419            if aiVerComponents[2] >= 51:
    1420                 if self.fpApiVer not in [4.3, 3.2,]:
     1420                if self.fpApiVer not in [6.1, 5.2, 4.3, 3.2,]:
    14211421                    self.fpApiVer += 0.1;
    14221422                else:
    1423                     self.fpApiVer += 1.1;
     1423                    self.fpApiVer = int(self.fpApiVer) + 1.0;
     1424            # fudge value to be always bigger than the nominal value (0.1 gets rounded down)
     1425            if round(self.fpApiVer, 1) > self.fpApiVer:
     1426                self.fpApiVer += sys.float_info.epsilon * self.fpApiVer / 2.0;
    14241427
    14251428            try:
Note: See TracChangeset for help on using the changeset viewer.

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