How To Use
 All Modules Pages
C++ sample: Testcase with oERROR + AFTER_N_CALLS_ACTIVE_ONCE
TTB_TEST_FUNC(TriggerProgrammedError)
{
SomeSimulatedObject a("SimObjectA");
// Generate error for 2nd call of "CalculateSomething"
a._SetOption(TTB::Option::oERROR, "CalculateSomething",
TTB::OptionType::AFTER_N_CALLS_ACTIVE_ONCE, 2);
int result;
a.CalculateSomething(17, result);
a.CalculateSomething(18, result);
a.CalculateSomething(19, result);
a.CalculateSomething(20, result);
a.CalculateSomething(21, result);
TTB_EXP("CalculateSomething in_val=17 out_val=34 (SimObjectA)");
TTB_EXP("CalculateSomething in_val=18 out_val=-99 return error (SimObjectA)");
TTB_EXP("CalculateSomething in_val=19 out_val=38 (SimObjectA)");
TTB_EXP("CalculateSomething in_val=20 out_val=40 (SimObjectA)");
TTB_EXP("CalculateSomething in_val=21 out_val=42 (SimObjectA)");
}