MCPcopy Create free account
hub / github.com/Blizzard/s2client-api / OnTestFinish

Method OnTestFinish

tests/test_feature_layer.cc:33–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31 }
32
33 void OnTestFinish() override {
34 // Cleanup Test
35 KillAllUnits();
36
37 // Validate Result
38 FeatureLayer8BPP data;
39 const char* error = GetPlayerRelativeLayer(agent_, FeatureLayerType::MINIMAP, data);
40 if (error) {
41 ReportError(error);
42 return;
43 }
44
45 bool foundUnit = false;
46 for (int x = 0; x < data.width; ++x) {
47 for (int y = 0; y < data.height; ++y) {
48 char value = data.Read(Point2DI(x, y));
49 if (value > 0) {
50 foundUnit = true;
51 }
52 }
53 }
54
55 if (!foundUnit)
56 ReportError("Unit not found in feature layer");
57 }
58};
59
60

Callers

nothing calls this directly

Calls 3

GetPlayerRelativeLayerFunction · 0.85
Point2DIClass · 0.85
ReadMethod · 0.45

Tested by

no test coverage detected