Bug #1092
assert statements in TOF code
Start date:
06 August 2012
Due date:
% Done:
100%
Estimated time:
Workflow:
New Issue
Description
I had a complaint about the copious use of assert statements - as exceptions can be handled but asserts cannot. I notice that you use assert statements rather a lot in the tof code. I think it is better to throw an exception - because that can be handled whereas assert cannot. Would you mind changing out the asserts for exceptions? For example,
#include "src/legacy/Interface/Squeal.hh"
throw(Squeal(Squeal::recoverable, "Some error message", "String::Location::ofTheCode"));
I even went so far as to disable assert statements at build time using an NDEBUG compile flag... so these asserts don't do anything right now.
Updated by Rogers, Chris over 11 years ago
(I should add - you can set an environment variable, $maus_assert_active to activate asserts. But they should only be used for debugging)
Updated by Rajaram, Durga over 11 years ago
I assume you're talking about the tof digitizer code? I'll fix it.
Updated by Rajaram, Durga over 11 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Sorry -- yes.
Updated by Rogers, Chris over 11 years ago
- Target version changed from Future MAUS release to MAUS-v0.3.2