Skip to content
Snippets Groups Projects

Fix the variable definition initialization rules and add test for Def…

Merged Podhorszki, Norbert requested to merge github/fork/pnorbert/fix-variable-definitions into master

Created by: pnorbert

…ineVariable.

Fixed and tested defining local values, joined arrays and global arrays with correct parameters.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
29 29 {
30 30 if (m_DebugMode)
31 31 {
32 variable.CheckDims("in call to Write");
32 variable.CheckDimsBeforeWrite("Write(" + variable.m_Name + ")");
  • Created by: williamfgc

    @pnorbert This might create confusion since the user might rush to look for a Write(const string &name, T* ) signature, (e.g. Write("myvar", var.data() ); )...I would keep it as "in call to Write" since the Variable.m_Name is already printed by the exception throw by either CheckDimsCommon or CheckDimsBeforeWrite. Still, this shouldn't stop the PR.

  • Podhorszki, Norbert
    Podhorszki, Norbert @pnb started a thread on commit c68ed079
  • 265 257 }
    266 258
    267 259 /* Extra checks for invalid settings */
    260 if (m_DebugMode)
    261 CheckDimsCommon("DefineVariable(" + m_Name + ")");
    • Created by: williamfgc

      Like in here, DefineVariable("myvar") is what the user needs to look for. This is a good debugging message as it's non-ambiguous.

  • Podhorszki, Norbert
    Podhorszki, Norbert @pnb started a thread on commit c68ed079
  • 137 137 /** Registered transforms */
    138 138 std::vector<TransformInfo> m_TransformsInfo;
    139 139
    140 /** Self-check dims according to type, called right after DefineVariable and
    141 * SetSelection.
    142 * @param hint extra debugging info for the exception */
    143 void CheckDimsCommon(const std::string hint) const;
  • Created by: williamfgc

    @pnorbert Great job! and thanks for adding the test cases.

  • Please register or sign in to reply
    Loading