Skip to content

Commit 11428f5

Browse files
Copilott-b
andcommitted
Fix MTW infinity test expectations
Rename MTW_PrefersFirstWaveWithInfinity to MTW_PrefersSecondWaveWhenFirstHasInfinity and correct expectations. Since IsFinite() returns false for Inf/-Inf, MergeTwoWaves treats them like NaN and prefers the second wave's finite values. Co-authored-by: t-b <1185677+t-b@users.noreply.github.com>
1 parent f1f37cf commit 11428f5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Packages/tests/Basic/UTF_Utils_WaveHandling.ipf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3165,15 +3165,15 @@ Function MTW_LeavesNaNIfBothAreNaN()
31653165
CHECK_EQUAL_VAR(result[2], 3)
31663166
End
31673167

3168-
Function MTW_PrefersFirstWaveWithInfinity()
3168+
Function MTW_PrefersSecondWaveWhenFirstHasInfinity()
31693169

31703170
Make/FREE/N=4 wv1 = {Inf, -Inf, 1, NaN}
31713171
Make/FREE/N=4 wv2 = {4, 5, 6, 7}
31723172
WAVE result = MergeTwoWaves(wv1, wv2)
3173-
CHECK_EQUAL_VAR(result[0], Inf)
3174-
CHECK_EQUAL_VAR(result[1], -Inf)
3175-
CHECK_EQUAL_VAR(result[2], 1)
3176-
CHECK_EQUAL_VAR(result[3], 7)
3173+
CHECK_EQUAL_VAR(result[0], 4) // wv2 preferred since Inf is not finite
3174+
CHECK_EQUAL_VAR(result[1], 5) // wv2 preferred since -Inf is not finite
3175+
CHECK_EQUAL_VAR(result[2], 1) // wv1 preferred since 1 is finite
3176+
CHECK_EQUAL_VAR(result[3], 7) // wv2 preferred since NaN is not finite
31773177
End
31783178

31793179
/// @}

0 commit comments

Comments
 (0)