* Set up the agent with RHS functions common to these * FunctionalTests. */
| 179 | * FunctionalTests. |
| 180 | */ |
| 181 | void FunctionalTestHarness::installRHS(sml::Agent* agent) |
| 182 | { |
| 183 | // set up the agent with common RHS functions |
| 184 | ::rhs_function* halt_function = lookup_rhs_function(internal_agent, make_str_constant(internal_agent, "halt")); |
| 185 | halt_routine = halt_function->f; |
| 186 | |
| 187 | auto call_routine = [](::agent* thisAgent, ::list* args, void* user_data) -> Symbol* { |
| 188 | return static_cast<user_data_struct*>(user_data)->function(); |
| 189 | }; |
| 190 | |
| 191 | halt_function->user_data = &haltData; |
| 192 | halt_function->f = call_routine; |
| 193 | |
| 194 | add_rhs_function(internal_agent, |
| 195 | make_str_constant(internal_agent, "failed"), |
| 196 | call_routine, |
| 197 | 0, false, true, |
| 198 | &failedData); |
| 199 | |
| 200 | add_rhs_function(internal_agent, |
| 201 | make_str_constant(internal_agent, "succeeded"), |
| 202 | call_routine, |
| 203 | 0, false, true, |
| 204 | &succeededData); |
| 205 | } |
| 206 |
nothing calls this directly
no test coverage detected