From 9ee6214d40198fe233892fe23f4601b2948b7961 Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Wed, 22 Mar 2023 18:53:17 +0100 Subject: [PATCH] GenerateDimLabelDifference: Don't ignore case We use EqualWaves for comparison of dimension labels and that does it since forever case sensitive. So we have to also output a difference if the labels only differ in case. Bug introduced in the initial version in 493779da (EQUAL_WAVE_WRAPPER: Work around EqualWaves dimension labels bug, 2019-03-12). --- docu/sphinx/source/changelog.rst | 2 ++ procedures/igortest-basics.ipf | 2 +- tests/VTTE.ipf | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docu/sphinx/source/changelog.rst b/docu/sphinx/source/changelog.rst index d436d322..24189548 100644 --- a/docu/sphinx/source/changelog.rst +++ b/docu/sphinx/source/changelog.rst @@ -50,6 +50,8 @@ The format is based on `Keep a Changelog ` and the `original article page 36 `__ - Fixed a bug where when running IUTF in an independent module, the ``run`` function was searched in ``ProcGlobal`` instead of the independent module. +- Fixed a bug where generating the detailed message for failed wave equality assertions did not ignore the case for + comparing dimension labels. Test assertions ~~~~~~~~~~~~~~~ diff --git a/procedures/igortest-basics.ipf b/procedures/igortest-basics.ipf index e1ba68cb..ad13c2d9 100644 --- a/procedures/igortest-basics.ipf +++ b/procedures/igortest-basics.ipf @@ -206,7 +206,7 @@ Function GenerateDimLabelDifference(wv1, wv2, msg) numEntries = DimSize(label1, i) for(j = 0; j < numEntries; j += 1) - if(!cmpstr(label1[j], label2[j])) + if(!cmpstr(label1[j], label2[j], 1)) continue endif str1 = label1[j] diff --git a/tests/VTTE.ipf b/tests/VTTE.ipf index d4517bec..ac0a5214 100644 --- a/tests/VTTE.ipf +++ b/tests/VTTE.ipf @@ -459,6 +459,14 @@ static Function TestIUTF() Ensure(!IUTF_Checks#AreWavesEqual(wvDP, wvSP, WAVE_LOCK_STATE, DEFAULT_TOLERANCE, detailedMsg)) Ensure(!IUTF_Checks#AreWavesEqual(wvDP, wvSP, DATA_FULL_SCALE, DEFAULT_TOLERANCE, detailedMsg)) Ensure(!IUTF_Checks#AreWavesEqual(wvDP, wvSP, DIMENSION_SIZES, DEFAULT_TOLERANCE, detailedMsg)) + + Make/FREE dimLabel1, dimLabel2 + + SetDimLabel 0, 0, abcd, dimLabel1 + SetDimLabel 0, 0, abcD, dimLabel2 + Ensure(!IUTF_Checks#AreWavesEqual(dimLabel1, dimLabel2, DIMENSION_LABELS, DEFAULT_TOLERANCE, detailedMsg)) + Ensure(IUTF_Checks#IsProperString(detailedMsg)) + Ensure(strsearch(detailedMsg, "abcD", 0) >= 0) // @} // HasWaveMajorType