Skip to content

Commit

Permalink
SFH_ASSERT: Output error message when debugging tests
Browse files Browse the repository at this point in the history
The INFO function is only available when igortest is included.

There are several ways to achieve the validity on compilation:
1. Check if the function exists with #ifdef (as done here)
2. Determining the function dynamically through FUNCREF
3. Conditionally recompile with dynamically added defines
4. Provide a "null" function in MIES with the same signature.

Disadvantages:
1. does not scale well, only applies to a single function
2. needs a prototype function in MIES and will fail if function signature changes in igortest
3. Allows larger codeblocks with external functions but does not scale well and rather slow
4. needs like 2 a function with the same signature as in igortest

We decided for 1 as it seems to impose the smallest disadvantages
  • Loading branch information
t-b authored and MichaelHuth committed Sep 18, 2024
1 parent 67112f6 commit 5d4074d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Packages/MIES/MIES_SweepFormula_Helpers.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,14 @@ Function SFH_ASSERT(variable condition, string message, [variable jsonId])
endif
SVAR error = $GetSweepFormulaParseErrorMessage()
error = message

#ifdef AUTOMATED_TESTING_DEBUGGING

#ifdef AUTOMATED_TESTING
#if exists("INFO")
INFO("SFH_ASSERT: %s", s0 = error)
#endif
#endif
Debugger
#endif
Abort
Expand Down

0 comments on commit 5d4074d

Please sign in to comment.