C2026-041-invisible-position-changes-as-differences

This commit is contained in:
2026-09-02 14:47:09 -04:00
parent 8e7be9723e
commit 213b8d18f7
3 changed files with 47 additions and 25 deletions
+1 -1
View File
@@ -277,7 +277,7 @@
this.lbProcedures.FormattingEnabled = true;
this.lbProcedures.Location = new System.Drawing.Point(0, 0);
this.lbProcedures.Name = "lbProcedures";
this.lbProcedures.Size = new System.Drawing.Size(150, 46);
this.lbProcedures.Size = new System.Drawing.Size(707, 25);
this.lbProcedures.TabIndex = 1;
this.tt.SetToolTip(this.lbProcedures, "Procedures withDifferences or Search Text");
this.lbProcedures.SelectedIndexChanged += new System.EventHandler(this.lbProcedures_SelectedIndexChanged);
+46 -19
View File
@@ -46,7 +46,6 @@ using System.Data;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
@@ -849,12 +848,9 @@ namespace Baseline
public partial class FindFiles : List<FindFile>
{
private readonly string _FileName;
private object _fileName;
public string FileName => _FileName;
//public bool TruncatedDataFg { get; set; } = false;
/// <summary>
/// Build list of DocVersion Folders with differences
/// </summary>
@@ -974,35 +970,66 @@ namespace Baseline
}
return false;
}
private void FillByCompare(DirectoryInfo di1, DirectoryInfo di2, string fileName, IgnoreLines myIgnore, bool TruncatedDataFg = false, bool foundFileFg = false)
private void FillByCompare(DirectoryInfo di1, DirectoryInfo di2, string fileName, IgnoreLines myIgnore, bool isTruncatedChecked = false, bool foundFileFg = false)
{
if (TruncatedDataFg) // C2026-041 is the "Use Truncated Data" checked
{
if (!foundFileFg) // flag to indicate if the correct DebugMeta file has been found.
{
fileName = getDebubMetaFile(di1, di2, ref foundFileFg); // C2026-041 Check if the DebugMeta_Truncate.txt file is found in the baseline bench mark and the new release being tested.
}
}
//if (isTruncatedChecked) // C2026-041 is the "Use Truncated Data" checked
//{
// if (!foundFileFg) // flag to indicate if the correct DebugMeta file has been found.
// {
// fileName = getDebubMetaFile(di1, di2, ref foundFileFg); // C2026-041 Check if the DebugMeta_Truncate.txt file is found in the baseline bench mark and the new release being tested.
// }
//}
foreach (DirectoryInfo diChild1 in di1.GetDirectories())
{
DirectoryInfo diChild2 = new DirectoryInfo(Path.Combine(di2.FullName + "\\" + diChild1.Name));
DirectoryInfo diChild2 = new DirectoryInfo(Path.Combine(di2.FullName, diChild1.Name));
if (diChild2.Exists)
FillByCompare(diChild1, diChild2, fileName,myIgnore, TruncatedDataFg, foundFileFg);// Recursively work on Sub-Folders
FillByCompare(diChild1, diChild2, fileName,myIgnore, isTruncatedChecked, foundFileFg);// Recursively work on Sub-Folders
}
//foreach (FileInfo fiChild1 in di1.GetFiles(fileName))
//{
// FileInfo fiChild2 = new FileInfo(Path.Combine(di2.FullName, fiChild1.Name));
// if (fiChild2.Exists)
// {
// if (CompareFile(fiChild1, fiChild2, myIgnore))
// Add(new FindFile(fiChild1.FullName, fiChild2.FullName));// Process Each File
// }
//}
foreach (FileInfo fiChild1 in di1.GetFiles(fileName))
{
FileInfo fiChild2 = new FileInfo(Path.Combine(di2.FullName, fiChild1.Name));
if (fiChild2.Exists)
FileInfo fiChild1_truncated = new FileInfo(fiChild1.FullName.Replace(".txt", "_Truncated.txt"));
FileInfo fiChild2_truncated = new FileInfo(fiChild2.FullName.Replace(".txt", "_Truncated.txt"));
//truncate checked and both files exist
if (isTruncatedChecked && fiChild1_truncated.Exists && fiChild2_truncated.Exists)
{
if (CompareFile(fiChild1, fiChild2,myIgnore))
Add(new FindFile(fiChild1.FullName, fiChild2.FullName));// Process Each File
if (CompareFile(fiChild1_truncated, fiChild2_truncated, myIgnore))
Add(new FindFile(fiChild1_truncated.FullName, fiChild2_truncated.FullName));
}
//truncate checked and only file 1 truncate files exist
else if (isTruncatedChecked && fiChild1_truncated.Exists && fiChild2.Exists)
{
if (CompareFile(fiChild1_truncated, fiChild2, myIgnore))
Add(new FindFile(fiChild1_truncated.FullName, fiChild2.FullName));
}
//truncate checked and only file 2 truncate files exist
else if (isTruncatedChecked && fiChild2_truncated.Exists)
{
if (CompareFile(fiChild1, fiChild2_truncated, myIgnore))
Add(new FindFile(fiChild1.FullName, fiChild2_truncated.FullName));
}
//truncated not checked or truncate files dont exist
else if (fiChild2.Exists)
{
if (CompareFile(fiChild1, fiChild2, myIgnore))
Add(new FindFile(fiChild1.FullName, fiChild2.FullName));
}
}
}
private string getDebubMetaFile(DirectoryInfo di1, DirectoryInfo di2, ref bool foundFileFg) // C2026-041
{
string flnm = "";
string flnm;
DirectoryInfo dr1 = di1.GetDirectories()[0]; // get first folder for test of which DebugMeta file to use. The DebugMeta files are found only ineach proc set folder.
if (!dr1.Name.Substring(0, 8).Contains("VEPROMS_") && !foundFileFg)
{
@@ -1025,7 +1052,7 @@ namespace Baseline
}
private bool CompareFile(FileInfo fiChild1, FileInfo fiChild2,IgnoreLines myIgnore)
{
if (fiChild1.Name == "DebugMeta.txt")
if (fiChild1.Name == "DebugMeta.txt" || fiChild1.Name == "DebugMeta_Truncated.txt")
{
IEnumerable<string> lines1 = ReadFilteredLines(fiChild1.FullName, false, myIgnore);//LINQ Read lines without ignored lines
IEnumerable<string> lines2 = ReadFilteredLines(fiChild2.FullName, false, myIgnore);//LINQ Read lines without ignored lines
-5
View File
@@ -158,11 +158,6 @@ namespace Volian.Base.Library
_MyDebugPrint.Close();
_MyDebugPrint_Truncated.Close();
}
public static void Write(string format, params object[] args)
{
_MyDebugPrint.Write(format, args);
}
public static void WriteLine(string format, params object[] args)
{
_MyDebugPrint_Truncated.WriteLine(format, args);