| 88 | } |
| 89 | |
| 90 | void FunctionalTestHarness::setUp() |
| 91 | { |
| 92 | halted = false; |
| 93 | failed = false; |
| 94 | |
| 95 | kernel = sml::Kernel::CreateKernelInCurrentThread(true); |
| 96 | agent = kernel->CreateAgent("soar1"); |
| 97 | |
| 98 | // /BEGIN WARN WARN: |
| 99 | // |
| 100 | // This works because we're using 'CreateKernelInCurrentThread(true)' |
| 101 | // THIS WILL BREAK OTHERWISE. WE DO NOT NEED FANCINESS HERE SO THIS IS GOOD |
| 102 | // BECAUSE WE CAN TEST INTERNAL AGENT WITH THIS. |
| 103 | // |
| 104 | // /END WARN WARN |
| 105 | |
| 106 | sml::EmbeddedConnectionSynch* connection = dynamic_cast<sml::EmbeddedConnectionSynch*>(kernel->GetConnection()); |
| 107 | |
| 108 | internal_kernel = connection->GetKernelSML(); |
| 109 | internal_agent = internal_kernel->GetAgentSML("soar1")->GetSoarAgent(); |
| 110 | |
| 111 | soar_add_callback(internal_agent, |
| 112 | AFTER_DECISION_CYCLE_CALLBACK, |
| 113 | [](::agent*, soar_callback_event_id, soar_callback_data data, soar_call_data) { |
| 114 | static_cast<FunctionalTestHarness*>(data)->afterDecisionCycleHandler(); |
| 115 | }, |
| 116 | AFTER_DECISION_CYCLE_CALLBACK, |
| 117 | this, |
| 118 | [](soar_callback_data){}, |
| 119 | "Prototype-UnitTesting AFTER_DECISION_CYCLE_CALLBACK"); |
| 120 | |
| 121 | soar_add_callback(internal_agent, |
| 122 | PRINT_CALLBACK, |
| 123 | [](::agent*, soar_callback_event_id, soar_callback_data data, soar_call_data msg) { |
| 124 | static_cast<FunctionalTestHarness*>(data)->printHandler(static_cast<const char*>(msg)); |
| 125 | }, |
| 126 | PRINT_CALLBACK, |
| 127 | this, |
| 128 | [](soar_callback_data){}, |
| 129 | "Prototype-UnitTesting PRINT_CALLBACK"); |
| 130 | |
| 131 | installRHS(agent); |
| 132 | } |
| 133 | |
| 134 | void FunctionalTestHarness::tearDown(bool caught) |
| 135 | { |
nothing calls this directly
no test coverage detected