Skip to content

Commit

Permalink
removed the debug stmts and added tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
annaibm committed Apr 11, 2024
1 parent 2b1249e commit bbcd29a
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions src/org/testKitGen/TestInfoParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -447,18 +447,18 @@ private boolean matchPlat(String fullSpec, String pr) {
String microArchVersion = prSplitOnDot[2];
String environmentMicroArch = arg.getMicroArch();
boolean isZCharMatch = environmentMicroArch.startsWith(microArchVersion.substring(0, 1));
boolean isZStart = microArchVersion.startsWith("z") && environmentMicroArch.startsWith("z");
boolean isZStart = microArchVersion.startsWith("z") && environmentMicroArch.startsWith("z");
if (!(isZCharMatch || isZStart)) {
System.out.println("Debug: The environment microarchitecture does not match required starting character or 'z' prefix.");
System.out.println("The microarchitecture does not match required starting character of 'z' prefix.");
return false;
}
if (!environmentMicroArch.startsWith(microArchVersion.substring(0, 1))) {
return false;
}
if (microArchVersion.endsWith("+")){
if (microArchVersion.endsWith("+")) {
return isVersionCompare(microArchVersion,environmentMicroArch);
}else {
if(!environmentMicroArch.equals(microArchVersion)){
} else {
if(!environmentMicroArch.equals(microArchVersion)) {
return false;
}
}
Expand Down Expand Up @@ -487,28 +487,23 @@ private boolean matchPlat(String fullSpec, String pr) {

private boolean isVersionCompare(String prVersion, String environmentVersion) {
Pattern pattern = Pattern.compile("\\d+");
Matcher prMatcher = pattern.matcher(prVersion);
Matcher envMatcher = pattern.matcher(environmentVersion);
Matcher prMatcher = pattern.matcher(prVersion);
Matcher envMatcher = pattern.matcher(environmentVersion);

int prVersionNumber = 0;
int environmentVersionNumber = 0;
int prVersionNumber = 0;
int environmentVersionNumber = 0;
try {
if (prMatcher.find()) {
String prVersionNum = prVersion.endsWith("+") ? prMatcher.group() : prMatcher.group().substring(0, prMatcher.group().length());
prVersionNumber = Integer.parseInt(prVersionNum);
System.out.println("Debug: Extracted pr version number: " + prVersionNumber);
}
if (envMatcher.find()) {
environmentVersionNumber = Integer.parseInt(envMatcher.group().substring(0, envMatcher.group().length()));
System.out.println("Debug: Extracted detected environmentVersionNumber: " + environmentVersionNumber);
}
} catch (NumberFormatException e) {
System.err.println("Version comparison error: " + e.getMessage());
return false;
}
boolean comparisonResult = prVersionNumber > environmentVersionNumber;
System.out.println("Debug: Required version (" + prVersionNumber + ") > Environment version (" + environmentVersionNumber + ")? : " + comparisonResult);

if (prVersionNumber > environmentVersionNumber) {
return false;
}
Expand Down

0 comments on commit bbcd29a

Please sign in to comment.