++
добавление учета пробелов в сравнение
This commit is contained in:
@@ -673,7 +673,7 @@ public class TestsDatabase extends SQLiteDatabase {
|
||||
Vector<DVMCompilationOptionsSet> optionsSets = getVectorByFK(dvmSettings_in, DVMCompilationOptionsSet.class);
|
||||
Vector<DVMEnvironmentsSet> environmentsSets = getVectorByFK(dvmSettings_in, DVMEnvironmentsSet.class);
|
||||
//----
|
||||
if (optionsSets.isEmpty() && environmentsSets.isEmpty()){
|
||||
if (optionsSets.isEmpty() && environmentsSets.isEmpty()) {
|
||||
return res;
|
||||
}
|
||||
int size_ = Math.min(optionsSets.size(), environmentsSets.size());
|
||||
@@ -687,14 +687,14 @@ public class TestsDatabase extends SQLiteDatabase {
|
||||
environmentsLine));
|
||||
}
|
||||
//дополнения
|
||||
if (optionsSets.size()<environmentsSets.size()){
|
||||
if (optionsSets.size() < environmentsSets.size()) {
|
||||
for (int i = optionsSets.size(); i < environmentsSets.size(); ++i) {
|
||||
res.add(new Pair<>(
|
||||
"",
|
||||
printEnvironmentsLine(getVectorByFK(environmentsSets.get(i), DVMEnvironment.class))
|
||||
));
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
if (optionsSets.size() > environmentsSets.size()) {
|
||||
for (int i = environmentsSets.size(); i < optionsSets.size(); ++i) {
|
||||
res.add(new Pair<>(
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.Json;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor;
|
||||
import _VisualDVM.Constants;
|
||||
@@ -7,13 +6,11 @@ import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
import _VisualDVM.ProjectData.Files.FileType;
|
||||
import _VisualDVM.ProjectData.Files.ProjectFile;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
import _VisualDVM.ProjectData.Messages.Errors.MessageError;
|
||||
import _VisualDVM.ProjectData.Messages.FileMessagesJson;
|
||||
import _VisualDVM.ProjectData.Messages.Message;
|
||||
import _VisualDVM.ProjectData.Messages.MessagesJson;
|
||||
import _VisualDVM.ProjectData.Project.db_project_info;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||
import _VisualDVM.Utils;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
@@ -23,8 +20,6 @@ import java.nio.charset.Charset;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
|
||||
import static java.lang.Character.isDigit;
|
||||
public class SapforVersion_json implements Serializable {
|
||||
@Expose
|
||||
public String version = "";
|
||||
@@ -127,40 +122,6 @@ public class SapforVersion_json implements Serializable {
|
||||
}
|
||||
}
|
||||
}
|
||||
public boolean isMatch(SapforVersion_json version_json) {
|
||||
if (!description.equals(version_json.description)) {
|
||||
return false;
|
||||
}
|
||||
if (files.size() != version_json.files.size()) {
|
||||
return false;
|
||||
}
|
||||
for (String name1 : files.keySet()) {
|
||||
if (!version_json.files.containsKey(name1)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (String name1 : files.keySet()) {
|
||||
ProjectFile file1 = files.get(name1);
|
||||
ProjectFile file2 = version_json.files.get(name1);
|
||||
//---
|
||||
String text1 = "";
|
||||
String text2 = "";
|
||||
try {
|
||||
text1 = FileUtils.readFileToString(file1.file, Charset.defaultCharset());
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
try {
|
||||
text2 = FileUtils.readFileToString(file2.file, Charset.defaultCharset());
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
if (!Utils.compareFortranTexts(text1, text2)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public boolean isMatchServer(SapforVersion_json version_json) {
|
||||
if (!description.equals(version_json.description)) {
|
||||
return false;
|
||||
@@ -229,26 +190,25 @@ public class SapforVersion_json implements Serializable {
|
||||
if (err.exists())
|
||||
project.Log += "\n" + FileUtils.readFileToString(err);
|
||||
//--
|
||||
if (messages_dump.exists()){
|
||||
if (messages_dump.exists()) {
|
||||
try {
|
||||
String packed = FileUtils.readFileToString(messages_dump);
|
||||
messagesJson = Utils_.gson.fromJson(packed, MessagesJson.class);
|
||||
}
|
||||
catch (Exception ex){
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
project.Open();
|
||||
project.Update(); //Журнал
|
||||
//а так же, убрать dep и txt
|
||||
if (messagesJson!=null){
|
||||
if (messagesJson != null) {
|
||||
project.db.BeginTransaction();
|
||||
//-
|
||||
for (FileMessagesJson fileMessagesJson: messagesJson.allMessages){
|
||||
for (FileMessagesJson fileMessagesJson : messagesJson.allMessages) {
|
||||
fileMessagesJson.file = Utils_.toW(fileMessagesJson.file);
|
||||
//--
|
||||
DBProjectFile file = project.db.files.Data.get(fileMessagesJson.file);
|
||||
for (Message message: fileMessagesJson.messages) {
|
||||
for (Message message : fileMessagesJson.messages) {
|
||||
file.CreateAndAddNewMessage(1, message.value, message.line, message.group);
|
||||
}
|
||||
//update file
|
||||
|
||||
@@ -155,7 +155,7 @@ public class SapforTask extends DBObject {
|
||||
SapforVersion_json version1 = versions1.get(name1);
|
||||
SapforVersion_json version2 = versions2.get(name1);
|
||||
//---
|
||||
if (!version1.isMatch(version2)) {
|
||||
if (!version1.isMatchServer(version2)) {
|
||||
comparisonState = ComparisonState.NotMatch;
|
||||
task2.comparisonState = ComparisonState.NotMatch;
|
||||
version1.comparisonState = VersionComparisonState.NotMatch;
|
||||
|
||||
@@ -195,7 +195,7 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
||||
Print("сравнение завершено");
|
||||
log.Writeln_("Различий с эталоном: " + testingPackage.mismatchesCount);
|
||||
if (testingPackage.mismatchesCount > 0) {
|
||||
// testingPackage.doneTasksCount -= testingPackage.mismatchesCount;
|
||||
// testingPackage.doneTasksCount -= testingPackage.mismatchesCount;
|
||||
testingPackage.state = TasksPackageState.DoneWithErrors;
|
||||
}
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user