The FailureInducer simulates errors. More...
Go to the source code of this file.
Classes | |
class | Hypertable::FailureInducer |
struct | Hypertable::FailureInducer::failure_inducer_state |
Internal structure to store a single failure setting. More... | |
Namespaces | |
Hypertable | |
Hypertable definitions | |
Macros | |
#define | HT_MAYBE_FAIL(_label_) |
#define | HT_MAYBE_FAIL_X(_label_, _exp_) |
#define | HT_FAILURE_SIGNALLED(_label_) |
The FailureInducer simulates errors.
The FailureInducer parses a list of specs (usually set in a test) and returns errors, throws exceptions or terminates the application depending on the these arguments.
There are a few helper macros that will check for induced failures:
Will induce a failure if "label" is active HT_MAYBE_FAIL(label)
Will induce a failure if "label" is active and "test" is true HT_MAYBE_FAIL_X(label, test)
Allows usage in an "if" block: if (HT_FAILURE_SIGNALLED("lbl")) { } HT_FAILURE_SIGNALLED(label) { }
A FailureInducer spec has the following layout: label:action<(parameter)>:iteration
Examples: label:exit:0 label:signal:10 label:pause(<milli-sec>):5 label:throw(<decimal-code>):0 label:throw(0x<hexadecimal-code>):0
Definition in file FailureInducer.h.
#define HT_FAILURE_SIGNALLED | ( | _label_ | ) |
Definition at line 148 of file FailureInducer.h.
#define HT_MAYBE_FAIL | ( | _label_ | ) |
Definition at line 134 of file FailureInducer.h.
#define HT_MAYBE_FAIL_X | ( | _label_, | |
_exp_ | |||
) |
Definition at line 142 of file FailureInducer.h.