| 217 | |
| 218 | |
| 219 | void EpMemFunctionalTests::testMultiAgent() |
| 220 | { |
| 221 | std::vector<sml::Agent*> agents; |
| 222 | |
| 223 | for (int i = 1;i <= 250;i++) |
| 224 | { |
| 225 | std::stringstream ss("Agent "); |
| 226 | ss << i; |
| 227 | |
| 228 | sml::Agent* t = kernel->CreateAgent(ss.str().c_str()); |
| 229 | std::string sourceName = getCategoryName() + "_testMultiAgent.soar"; |
| 230 | std::string sourceUrl = SoarHelper::GetResource(sourceName); |
| 231 | assertNonZeroSize_msg("Could not find test file " + sourceName, sourceUrl); |
| 232 | agent->ExecuteCommandLine(("source " + sourceUrl).c_str()); |
| 233 | |
| 234 | agents.push_back(t); |
| 235 | } |
| 236 | |
| 237 | kernel->RunAllAgents(3); |
| 238 | |
| 239 | for (auto a : agents) |
| 240 | { |
| 241 | try |
| 242 | { |
| 243 | if (SoarHelper::getDecisionPhasesCount(a) != 3) |
| 244 | { |
| 245 | throw AssertException("Agent did not stop correctly! Ran too many cycles!", __FILE__, __LINE__); |
| 246 | } |
| 247 | |
| 248 | std::string result = a->ExecuteCommandLine("epmem"); |
| 249 | |
| 250 | if (result.find("memory") == std::string::npos) |
| 251 | { |
| 252 | throw AssertException("Non Memory Driver!", __FILE__, __LINE__); |
| 253 | } |
| 254 | } |
| 255 | catch (AssertException& e) |
| 256 | { |
| 257 | kernel->DestroyAgent(a); |
| 258 | throw e; |
| 259 | } |
| 260 | |
| 261 | kernel->DestroyAgent(a); |
| 262 | } |
| 263 | } |
nothing calls this directly
no test coverage detected