Skip to content

Commit d91f78c

Browse files
author
Matthias Kastner
committed
Null Wave comparison
NULL_WAVE could not be as input to CHECK_WAVE() since binary comparison of `(type & NULL_WAVE) == NULL_WAVE` will always yield 1. bug introduced in 06b2e06: To ensure correct behaviour the following two test cases were used: ```igor Function MyTest() Make/FREE wv CHECK_WAVE(wv, NULL_WAVE) End Function MyTest2() WAVE/Z wv REQUIRE_WAVE(wv, NULL_WAVE) End ```
1 parent 2bf4653 commit d91f78c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

procedures/unit-testing-comparators.ipf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,12 @@ static Function TEST_WAVE_WRAPPER(wv, majorType, flags, [minorType])
489489
if(type2 > 0 && type2 <= 2)
490490
type = type | 2^(type2 + 3)
491491
endif
492-
result = (type & majorType) == majorType
492+
493+
if(majorType == NULL_WAVE)
494+
result = type == majorType
495+
else
496+
result = (type & majorType) == majorType
497+
endif
493498

494499
sprintf str, "Assumption that the wave's main type is %d", majorType
495500
SetTestStatusAndDebug(str, result)

0 commit comments

Comments
 (0)