| 118 | } |
| 119 | |
| 120 | void OnTestFinish() override { |
| 121 | const ObservationInterface* obs = agent_->Observation(); |
| 122 | |
| 123 | Units barracks_units = obs->GetUnits(Unit::Self, IsUnit(UNIT_TYPEID::TERRAN_BARRACKS)); |
| 124 | if (barracks_units.size() != 1) { |
| 125 | ReportError("Could not find landed barracks."); |
| 126 | } |
| 127 | |
| 128 | // Find the tech lab. |
| 129 | Units techlab_units = obs->GetUnits(Unit::Self, IsUnit(UNIT_TYPEID::TERRAN_BARRACKSTECHLAB)); |
| 130 | if (techlab_units.size() != 1) { |
| 131 | ReportError("Could not find a tech lab."); |
| 132 | } |
| 133 | |
| 134 | if (barracks_units.size() == 1 && techlab_units.size() == 1) { |
| 135 | if (barracks_units[0].add_on_tag == 0LL) { |
| 136 | ReportError("Barracks does not have an add-on."); |
| 137 | } |
| 138 | if (barracks_units[0].add_on_tag != techlab_units[0].tag) { |
| 139 | ReportError("Barracks add on tag does not match tech lab tag."); |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | VerifyUnitExistsAndComplete(UNIT_TYPEID::TERRAN_BARRACKSTECHLAB); |
| 144 | VerifyUnitIdleAfterOrder(test_unit_type_); |
| 145 | VerifyUnitIdleAfterOrder(UNIT_TYPEID::TERRAN_BARRACKSTECHLAB); |
| 146 | KillAllUnits(); |
| 147 | } |
| 148 | }; |
| 149 | |
| 150 | class TestBuildFlyingBarracksTechLab : public TestUnitCommandTargetingPoint { |
nothing calls this directly
no test coverage detected