1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Allow tests to use GDBs with versions of the form 7.12.50.201702140

Change-Id: I97e5cc7d6a702d743eba2d90bd73df8de3375de4
This commit is contained in:
Marc Khouzam 2017-02-15 11:04:18 -05:00
parent 793955eb12
commit c0e72388c7

View file

@ -177,11 +177,13 @@ public abstract class BaseParametrizedTestCase extends BaseTestCase {
String comparableActualString = actual;
if (expectedParts.length == 2 // If the expected version does not care about the maintenance number
&& actualParts.length == 3) { // and the actual version has a maintenance number
&& actualParts.length > 2) { // and the actual version has a maintenance number (and possibly more)
// We should ignore the maintenance number.
// For example, if we expect 7.12, then the actual
// version we should accept can be 7.12 or 7.12.1 or 7.12.2, etc.
comparableActualString = actual.substring(0, actual.lastIndexOf('.'));
// version we should accept can be 7.12 or 7.12.1 or 7.12.2, 7.12.50.20170214, etc.
int firstDot = actual.indexOf('.');
int secondDot = actual.indexOf('.', firstDot + 1);
comparableActualString = actual.substring(0, secondDot);
}
assertTrue("Unexpected GDB version. Expected " + expected + " actual " + actual,