Skip to content

Commit 21ffc93

Browse files
author
Matthias Kastner
committed
allow NULL_WAVE comparison
NULL_WAVE gets a non-zero binary flag to allow combination with other binary operations like REQUIRE_WAVE(wv, NULL_WAVE | DOUBLE_WAVE) which then fails if wv is a double wave. NULL_WAVE=0x1000 was chosen to ensure enough space for further WaveTypes() additions from upstream (WM).
1 parent a43c599 commit 21ffc93

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

procedures/unit-testing-comparators.ipf

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -480,22 +480,19 @@ static Function TEST_WAVE_WRAPPER(wv, majorType, flags, [minorType])
480480

481481
type2 = WaveType(wv, 2)
482482
type1 = WaveType(wv, 1)
483-
if(type1 == NULL_WAVE && type2 == NULL_WAVE)
484-
type = NULL_WAVE
485-
endif
486483
if(type1 > 0 && type1 <= 4)
487484
type = type | 2^(type1 - 1)
488485
endif
489486
if(type2 > 0 && type2 <= 2)
490487
type = type | 2^(type2 + 3)
491488
endif
492489

493-
if(majorType == NULL_WAVE)
494-
result = type == majorType
495-
else
496-
result = (type & majorType) == majorType
490+
if((type1 == 0 && type2 == 0) || !WaveExists(wv))
491+
type = NULL_WAVE
497492
endif
498493

494+
result = (type & majorType) == majorType
495+
499496
sprintf str, "Assumption that the wave's main type is %d", majorType
500497
SetTestStatusAndDebug(str, result)
501498

procedures/unit-testing-constants.ipf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Constant REQUIRE_MODE = 0x07 // == OUTPUT_MESSAGE | INCREASE_ERROR | ABORT_FUN
3232

3333
/// @addtogroup testWaveFlagsGeneral
3434
///@{
35-
Constant NULL_WAVE = 0x00
35+
Constant NULL_WAVE = 0x1000
3636
///@}
3737

3838
/// @addtogroup testWaveFlagsMinor

0 commit comments

Comments
 (0)