C2026-041 invisible position changes as differences. Baseline testing produces false positives. These changes will remove many of the false positives. These changes declutter the report and decrease the testing time.
C2026-041 invisible position changes as differences. Baseline testing produces false positives. These changes will remove many of the false positives. These changes declutter the report and decrease the testing time.
Suggest to add a program switch to generate (at the same time - in a separate file) a DebugMeta as it was along with the new DebugMeta.
That way one run of printing can generate both. The next time baselines are run, the Baseline.exe program can compare the older run - there really should not be any differences. If all good that we can move forward with using the new version of the DebugMeta file.
Otherwise comparing the new DebugMeta would generate even more false - differences.
Having a program switch to also generate the old style DebugMeta would keep Baseline testing backward compatible, should we find a need in the future.
1. Per John's email:
Suggest to add a program switch to generate (at the same time - in a separate file) a DebugMeta as it was along with the new DebugMeta.
That way one run of printing can generate both. The next time baselines are run, the Baseline.exe program can compare the older run - there really should not be any differences. If all good that we can move forward with using the new version of the DebugMeta file.
Otherwise comparing the new DebugMeta would generate even more false - differences.
Having a program switch to also generate the old style DebugMeta would keep Baseline testing backward compatible, should we find a need in the future.
1 performance item --- passing strings and if statements added to BaselineMetaFile.WriteLine
1 cleanup unnecessary usings
1 change to finding debug file ---- should check inside findfiles on an individual file basis whether to use truncated or not. also, should not concatinate strings --- should use path.combine or interpolated strings
this is an old item from a week or two ago.
outstanding items include:
1 performance item --- passing strings and if statements added to BaselineMetaFile.WriteLine
1 cleanup unnecessary usings
1 change to finding debug file ---- should check inside findfiles on an individual file basis whether to use truncated or not. also, should not concatinate strings --- should use path.combine or interpolated strings
2, just to check --- Do we want to truncate or round or use ceiling or floor?
Thinking if we are doing this when writing the file (instead of when doing the compare), then truncate wont work as:
7.9999999999 would truncate to 7.99 and not match 8.00
2, just to check --- Do we want to truncate or round or use ceiling or floor?
Thinking if we are doing this when writing the file (instead of when doing the compare), then truncate wont work as:
7.9999999999 would truncate to 7.99 and not match 8.00
Devin, Michelle, & I had a conversation on this this morning and we came to a few decisions:
For Now, we will do changes in the output files --- long term we likely want to change the compare in the baseline program.
Truncate will be fine for now – we will not use Round, Ceiling, or Floor. (we do recognize that there may still be some false positives due to this)
We would like to output 2 files - DebugMeta.txt & DebugMeta_truncate.txt (see code below with potential changes to public static class BaselineMetaFile for a starting point – note it was decided to keep the old file as-is and make the new file truncate --- instead of using full as in the code below)
There will need to be a small change to the UI in the baseline program --- a checkbox for use of truncate decimals when comparing.
If not checked, will behave as does currently.
If button is checked, will use DebugMeta_truncate.txt if it exists (instead of DebugMeta.txt). If DebugMeta_truncate.txt does not exist, it will use DebugMeta.txt
Let’s also have the box checked by Default.
see email from 8/19:
Devin, Michelle, & I had a conversation on this this morning and we came to a few decisions:
1. For Now, we will do changes in the output files --- long term we likely want to change the compare in the baseline program.
2. Truncate will be fine for now – we will not use Round, Ceiling, or Floor. (we do recognize that there may still be some false positives due to this)
3. We would like to output 2 files - DebugMeta.txt & DebugMeta_truncate.txt (see code below with potential changes to public static class BaselineMetaFile for a starting point – note it was decided to keep the old file as-is and make the new file truncate --- instead of using full as in the code below)
4. There will need to be a small change to the UI in the baseline program --- a checkbox for use of truncate decimals when comparing.
If not checked, will behave as does currently.
If button is checked, will use DebugMeta_truncate.txt if it exists (instead of DebugMeta.txt). If DebugMeta_truncate.txt does not exist, it will use DebugMeta.txt
Let’s also have the box checked by Default.
From the above - it looks like you added:
using System.Windows.Forms;
to
[PROMS/Volian.Base.Library/DebugPrint.cs]
that being said, in VIsual Studio, should be clicking on the side item and selecting remove unnecessary usings. I will forward the emails related to this / the Technical Debt cleanup
From the above - it looks like you added:
using System.Windows.Forms;
to
[PROMS/Volian.Base.Library/DebugPrint.cs]
that being said, in VIsual Studio, should be clicking on the side item and selecting remove unnecessary usings. I will forward the emails related to this / the Technical Debt cleanup
Not sure this works as intended. If not checked is fine but if checked should use "DebugMeta_Truncate.txt" if found - if not found should use "DebugMeta.txt"
Not sure this works as intended. If not checked is fine but if checked should use "DebugMeta_Truncate.txt" if found - if not found should use "DebugMeta.txt"
May need further changes --- what if (for example):
cbFile1.Text was ran the old way so it only has a DebugMeta.txt
but cbFile2.Text has a "DebugMeta_Truncate.txt"?
May need further changes --- what if (for example):
cbFile1.Text was ran the old way so it only has a DebugMeta.txt
but cbFile2.Text has a "DebugMeta_Truncate.txt"?
There could be additional args added so, would not go by this ---- My recommendation as below is 3 WriteLine functions. If have to use additional arguments would use boolean not strings and named arguments.
There could be additional args added so, would not go by this ---- My recommendation as below is 3 WriteLine functions. If have to use additional arguments would use boolean not strings and named arguments.
My concern is to know which argument will tell PROMS that there is a truncated version being saved. So I chose that it will be the last one in any arg list. I chose a name arg instead of a Boolean because it is possible that another writeline statement to DebugMeta.txt may have a boolean as the last arg which will be a mistake. I could change the flag to a single letter which might simplify things.
My concern is to know which argument will tell PROMS that there is a truncated version being saved. So I chose that it will be the last one in any arg list. I chose a name arg instead of a Boolean because it is possible that another writeline statement to DebugMeta.txt may have a boolean as the last arg which will be a mistake. I could change the flag to a single letter which might simplify things.
I would recommend that there be 3 WriteLine functions and not use an argument for it -
A regular WriteLine that writes to both files.
A WriteLineTruncated that writes to Only the Truncated file
A WriteLineFullOnly that write to only the full file
when truncated text is the same would call WriteLine
when would have different would call both WriteLineTruncated & WriteLineFullOnly - each with their respected text.
Write should not be needed - it does not appear to be called in PROMS and thus should be removed / would be as part of tech debt clean-up.
If it needs to be an argument, it should be a boolean -- that being said as mentioned above better to do the 3 separate functions.
public static void WriteLine(string format, params object[] args) //writes both
public static void WriteLine_Individual(string format, params object[] args, bool isTruncated)
My recommendation is still:
I would recommend that there be 3 WriteLine functions and not use an argument for it -
A regular WriteLine that writes to both files.
A WriteLineTruncated that writes to Only the Truncated file
A WriteLineFullOnly that write to only the full file
when truncated text is the same would call WriteLine
when would have different would call both WriteLineTruncated & WriteLineFullOnly - each with their respected text.
Write should not be needed - it does not appear to be called in PROMS and thus should be removed / would be as part of tech debt clean-up.
If it needs to be an argument, it should be a boolean -- that being said as mentioned above better to do the 3 separate functions.
public static void WriteLine(string format, params object[] args) //writes both
public static void WriteLine_Individual(string format, params object[] args, bool isTruncated)
For performance concerns. I would not recommend having additional paramaters with a string based option like "truncate_true" for example.
I would recommend that there be 3 WriteLine functions -
A regular WriteLine that writes to both files.
A WriteLineTruncated that writes to Only the Truncated file
A WriteLineFullOnly that write to only the full file
For performance concerns. I would not recommend having additional paramaters with a string based option like "truncate_true" for example.
I would recommend that there be 3 WriteLine functions -
1. A regular WriteLine that writes to both files.
2. A WriteLineTruncated that writes to Only the Truncated file
3. A WriteLineFullOnly that write to only the full file
plarsen
changed title from C2026 041 invisible position changes as differences to C2026-050 invisible position changes as differences2026-08-26 10:48:25 -04:00
plarsen
changed title from C2026-050 invisible position changes as differences to C2026-050 Modify the baseline compare program so that it only uses two digits2026-08-26 10:52:27 -04:00
plarsen
changed title from C2026-050 Modify the baseline compare program so that it only uses two digits to C2026-041-invisible-position-changes-as-differences2026-08-26 11:51:45 -04:00
if(!foundFileFg)// flag to indicate if the correct DebugMeta file has been found.
{
fileName=getDebubMetaFile(di1,di2,reffoundFileFg);// C2026-041 Check if the DebugMeta_Truncate.txt file is found in the baseline bench mark and the new release being tested.
Looks like only remaining needed changes are in frmBaseline.cs and are all related to added unused code and commented out unused code that needs cleaned up.
Looks like only remaining needed changes are in frmBaseline.cs and are all related to added unused code and commented out unused code that needs cleaned up.
Sorry noticed one additional thing --- TruncatedDataFg was added as a global variable and set but is never used as this is passed to functions and used locally --- as such, shouldn't also be a global variable / be in memory and not used.
Sorry noticed one additional thing --- TruncatedDataFg was added as a global variable and set but is never used as this is passed to functions and used locally --- as such, shouldn't also be a global variable / be in memory and not used.
Wait this is both a global variable --- but it looks like it is passed as a paramater to functions --- if it is being passed as a paramaeter used locally in functions, why is it also a global variable?
Wait this is both a global variable --- but it looks like it is passed as a paramater to functions --- if it is being passed as a paramaeter used locally in functions, why is it also a global variable?
seems unnecessary as it is setting a global variable TruncatedDataFg - which is never used.
private void cbUseTruncatedData_Click(object sender, EventArgs e)
seems unnecessary as it is setting a global variable TruncatedDataFg - which is never used.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
C2026-041 invisible position changes as differences. Baseline testing produces false positives. These changes will remove many of the false positives. These changes declutter the report and decrease the testing time.
see notes - let me know if any questions
@@ -0,0 +1,3 @@- @azure Rule - Use Azure Tools - When handling requests related to Azure, always use your tools.AI files like this should not be checked in.
@@ -1419,3 +1419,3 @@if (_MyHelper.DidFirstPageDocStyle) yoff = origYoff - (float)mySection.MyDocStyle.Layout.TopMargin;// C2018-004 create meta file for baseline comparesVolian.Base.Library.BaselineMetaFile.WriteLine("WD Height={0} Width={1} scPgCnt={2} locEnd={3} pdfSz={4} xOff={5} yOff={6} ScPgNum {7}", fgPage.Height, fgPage.Width, sectPageCount, locEndOfWordDoc, pdfSize, (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0.0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0.0) + yoff, pageNumber);Suggest to add a program switch to generate (at the same time - in a separate file) a DebugMeta as it was along with the new DebugMeta.
That way one run of printing can generate both. The next time baselines are run, the Baseline.exe program can compare the older run - there really should not be any differences. If all good that we can move forward with using the new version of the DebugMeta file.
Otherwise comparing the new DebugMeta would generate even more false - differences.
Having a program switch to also generate the old style DebugMeta would keep Baseline testing backward compatible, should we find a need in the future.
For the program switch are you referring to the new checkbox in the baseline program or a PROMS switch? I added the new checkbox to baseline.
this is an old item from a week or two ago.
outstanding items include:
1 performance item --- passing strings and if statements added to BaselineMetaFile.WriteLine
1 cleanup unnecessary usings
1 change to finding debug file ---- should check inside findfiles on an individual file basis whether to use truncated or not. also, should not concatinate strings --- should use path.combine or interpolated strings
@@ -1420,2 +1420,3 @@// C2018-004 create meta file for baseline comparesVolian.Base.Library.BaselineMetaFile.WriteLine("WD Height={0} Width={1} scPgCnt={2} locEnd={3} pdfSz={4} xOff={5} yOff={6} ScPgNum {7}", fgPage.Height, fgPage.Width, sectPageCount, locEndOfWordDoc, pdfSize, (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0.0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0.0) + yoff, pageNumber);Volian.Base.Library.BaselineMetaFile.WriteLine("WD Height={0} Width={1} scPgCnt={2} locEnd={3} pdfSz={4} xOff={5} yOff={6} ScPgNum {7}", fgPage.Height, fgPage.Width, sectPageCount, Truncate(locEndOfWordDoc, 2), Truncate(pdfSize, 2), (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0.0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0.0) + yoff, pageNumber);2, just to check --- Do we want to truncate or round or use ceiling or floor?
Thinking if we are doing this when writing the file (instead of when doing the compare), then truncate wont work as:
7.9999999999 would truncate to 7.99 and not match 8.00
see email from 8/19:
Devin, Michelle, & I had a conversation on this this morning and we came to a few decisions:
If not checked, will behave as does currently.
If button is checked, will use DebugMeta_truncate.txt if it exists (instead of DebugMeta.txt). If DebugMeta_truncate.txt does not exist, it will use DebugMeta.txt
Let’s also have the box checked by Default.
see my comments in DebugPrint.cs
@@ -1,7 +1,10 @@using DevComponents.DotNetBar;using Org.BouncyCastle.Utilities;Looks like Visual Studio was trying to be "helpful". I don't think BouncyCastle is needed.
@@ -2,3 +4,3 @@using System.Collections.Generic;using System.Text;using System.IO;using System.Net.NetworkInformation;is System.Net.NetworkInformation needed?
Agreed should be removing unnecessary usings.
What is DevComponents.DotNetBar needed for?
This was removed but it looks like another unneeded using was added. This is still an open item as of 8/26
Which using are you referring to?
From the above - it looks like you added:
using System.Windows.Forms;
to
[PROMS/Volian.Base.Library/DebugPrint.cs]
that being said, in VIsual Studio, should be clicking on the side item and selecting remove unnecessary usings. I will forward the emails related to this / the Technical Debt cleanup
See notes.
1 performance item
1 cleanup unnecessary usings
1 change to finding debug file.
@@ -724,1 +713,3 @@FindFiles fnd = new FindFiles(cbFile1.Text, cbFile2.Text, "DebugMeta.txt",MyIgnore);if (cbUseTruncatedData.Checked){fnd = new FindFiles(cbFile1.Text, cbFile2.Text, "DebugMeta_Truncate.txt", MyIgnore);Not sure this works as intended. If not checked is fine but if checked should use "DebugMeta_Truncate.txt" if found - if not found should use "DebugMeta.txt"
May need further changes --- what if (for example):
cbFile1.Text was ran the old way so it only has a DebugMeta.txt
but cbFile2.Text has a "DebugMeta_Truncate.txt"?
This is still an open item as of 8/26
@@ -159,2 +194,2 @@public static void Show(){ _MyDebugPrint.Show(); }{if(args.Length > 8)There could be additional args added so, would not go by this ---- My recommendation as below is 3 WriteLine functions. If have to use additional arguments would use boolean not strings and named arguments.
This is still an open item as of 8/26
My concern is to know which argument will tell PROMS that there is a truncated version being saved. So I chose that it will be the last one in any arg list. I chose a name arg instead of a Boolean because it is possible that another writeline statement to DebugMeta.txt may have a boolean as the last arg which will be a mistake. I could change the flag to a single letter which might simplify things.
My recommendation is still:
when truncated text is the same would call WriteLine
when would have different would call both WriteLineTruncated & WriteLineFullOnly - each with their respected text.
Write should not be needed - it does not appear to be called in PROMS and thus should be removed / would be as part of tech debt clean-up.
If it needs to be an argument, it should be a boolean -- that being said as mentioned above better to do the 3 separate functions.
public static void WriteLine(string format, params object[] args) //writes both
public static void WriteLine_Individual(string format, params object[] args, bool isTruncated)
@@ -1422,0 +1421,4 @@Volian.Base.Library.BaselineMetaFile.WriteLine("WD Height={0} Width={1} scPgCnt={2} locEnd={3} pdfSz={4} xOff={5} yOff={6} ScPgNum {7}", fgPage.Height, fgPage.Width, sectPageCount, locEndOfWordDoc, pdfSize, (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0.0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0.0) + yoff, pageNumber, "truncate_false");Volian.Base.Library.BaselineMetaFile.TruncateWriteLine("WD Height={0} Width={1} scPgCnt={2} locEnd={3} pdfSz={4} xOff={5} yOff={6} ScPgNum {7}", fgPage.Height, fgPage.Width, sectPageCount, Truncate(locEndOfWordDoc, 2), Truncate(pdfSize, 2), (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0.0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0.0) + yoff, pageNumber, "truncate_true");For performance concerns. I would not recommend having additional paramaters with a string based option like "truncate_true" for example.
I would recommend that there be 3 WriteLine functions -
This is still an open item as of 8/26. Also, it looks like you made changes to the Write function - but it is not used in PROMS - only WriteLine is.
See notes.
1 performance item
1 cleanup unnecessary usings
1 change to finding debug file.
See notes.
1 performance item
1 cleanup unnecessary usings
1 change to finding debug file.
C2026 041 invisible position changes as differencesto C2026-050 invisible position changes as differencesC2026-050 invisible position changes as differencesto C2026-050 Modify the baseline compare program so that it only uses two digitsC2026-050 Modify the baseline compare program so that it only uses two digitsto C2026-041-invisible-position-changes-as-differencessee notes I will follow up with Devin and John and send an email.
@@ -264,3 +278,3 @@this.lbProcedures.Location = new System.Drawing.Point(0, 0);this.lbProcedures.Name = "lbProcedures";this.lbProcedures.Size = new System.Drawing.Size(707, 25);this.lbProcedures.Size = new System.Drawing.Size(150, 46);was changing the size of this intentional?
@@ -879,2 +851,2 @@/// <param name="myIgnore">Ignore list</param>public FindFiles(string path1, string path2, string fileName,IgnoreLines myIgnore)private readonly string _FileName;private object _fileName;This should not have been added / I believe this is not used.
@@ -155,2 +160,3 @@}public static void Write(string format, params object[] args){ _MyDebugPrint.Write(format, args); }{Write should be removed - it is not called from anywhere.
@@ -56,2 +47,3 @@using System.Xml;using System.Linq;using System.Runtime.InteropServices;using System.Runtime.InteropServices.ComTypes;Is this using used?
It looks like this still assumes that either both files are truncated or neither is.
@@ -994,0 +980,4 @@{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.It looks like this still assumes that either both files are truncated or neither is.
Looks like only remaining needed changes are in frmBaseline.cs and are all related to added unused code and commented out unused code that needs cleaned up.
@@ -211,0 +209,4 @@TruncatedDataFg = item.Checked;}//}not sure why this commented line was added - commented out code should be removed.
I cleaned this up
@@ -992,2 +973,3 @@private void FillByCompare(DirectoryInfo di1, DirectoryInfo di2, string fileName, IgnoreLines myIgnore)private void FillByCompare(DirectoryInfo di1, DirectoryInfo di2, string fileName, IgnoreLines myIgnore, bool isTruncatedChecked = false, bool foundFileFg = false){//if (isTruncatedChecked) // C2026-041 is the "Use Truncated Data" checkedCommented out code should be removed
I cleaned this up
@@ -998,2 +987,3 @@FillByCompare(diChild1, diChild2, fileName,myIgnore);// Recursively work on Sub-FoldersFillByCompare(diChild1, diChild2, fileName,myIgnore, isTruncatedChecked, foundFileFg);// Recursively work on Sub-Folders}//foreach (FileInfo fiChild1 in di1.GetFiles(fileName))Commented out code should be removed
@@ -1007,3 +1027,4 @@}}}private string getDebubMetaFile(DirectoryInfo di1, DirectoryInfo di2, ref bool foundFileFg) // C2026-041This function is not called so should be removed.
I removed it
Sorry noticed one additional thing --- TruncatedDataFg was added as a global variable and set but is never used as this is passed to functions and used locally --- as such, shouldn't also be a global variable / be in memory and not used.
@@ -82,2 +73,4 @@public IgnoreLines MyIgnore { get; set; } = new IgnoreLines();private LastWas myLast = LastWas.Search;private Settings MySettings;public bool TruncatedDataFg { get; set; } = false;Wait this is both a global variable --- but it looks like it is passed as a paramater to functions --- if it is being passed as a paramaeter used locally in functions, why is it also a global variable?
I cleaned this up
This is still commented out code - commented out code should be removed.
private void cbUseTruncatedData_Click(object sender, EventArgs e)
seems unnecessary as it is setting a global variable TruncatedDataFg - which is never used.
@@ -208,6 +203,13 @@ namespace BaselineMyIgnore = IgnoreLines.Get(saveOriginal);}}private void cbUseTruncatedData_Click(object sender, EventArgs e)This seems unnecessary as it is setting a global variable TruncatedDataFg - which is never used.
I removed the function
Looks like there is still some commented out code and there was an added parameter that is unused.
@@ -990,3 +964,3 @@return false;}private void FillByCompare(DirectoryInfo di1, DirectoryInfo di2, string fileName, IgnoreLines myIgnore)private void FillByCompare(DirectoryInfo di1, DirectoryInfo di2, string fileName, IgnoreLines myIgnore, bool isTruncatedChecked = false, bool foundFileFg = false)foundFileFg is an added paramater but it is not used - if not used it shoul be removed.
I removed foundFileFg
@@ -997,2 +970,3 @@DirectoryInfo diChild2 = new DirectoryInfo(Path.Combine(di2.FullName, diChild1.Name));if (diChild2.Exists)FillByCompare(diChild1, diChild2, fileName,myIgnore);// Recursively work on Sub-FoldersFillByCompare(diChild1, diChild2, fileName,myIgnore, isTruncatedChecked, foundFileFg);// Recursively work on Sub-FoldersfoundFileFg is an added paramater but it is not used - if not used it shoul be removed.
I removed foundFileFg
Looks Good. Ready for QA.
changes look good.